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"
@ -52,7 +47,7 @@ in
inherit hostName;
}
))
(foldr (a: b: a // b) { })
(foldr (a: b: a // b) {})
];
};
}

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; };
localSystem = {inherit system;};
};
modules = [
modules =
[
(rootPath + "/home/${unixName}/configurations/${hostName}")
]
++ (with homeModules; [
@ -53,7 +51,7 @@ let
]
++ [
{
lib = { inherit (lib) youthlic; };
lib = {inherit (lib) youthlic;};
}
];
extraSpecialArgs = {
@ -68,17 +66,15 @@ let
};
};
};
in
{
in {
flake = {
homeConfigurations =
with lib;
foldr (a: b: a // b) { } (
homeConfigurations = with lib;
foldr (a: b: a // b) {} (
pipe
[
# Hostname
]
[ (map (hostName: makeHomeConfiguration { inherit hostName; })) ]
[(map (hostName: makeHomeConfiguration {inherit hostName;}))]
);
inherit homeModules;
};

View file

@ -4,22 +4,18 @@
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}") ];
modules = [(rootPath + "/nixos/configurations/${hostName}")];
specialArgs = {
inherit
inputs
@ -37,6 +33,6 @@ in
"Cape"
"Akun"
]
[ (flip genAttrs makeNixosConfiguration) ];
[(flip genAttrs makeNixosConfiguration)];
};
}

View file

@ -4,18 +4,15 @@
lib,
rootPath,
...
}:
let
}: let
inherit (self) outputs;
importWithArgs = lib.flip import { inherit inputs outputs; };
in
{
flake.overlays =
with lib;
importWithArgs = lib.flip import {inherit inputs outputs;};
in {
flake.overlays = with lib;
pipe
[
"modifications"
"additions"
]
[ (flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))) ];
[(flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}")))];
}

View file

@ -2,30 +2,26 @@
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; };
localSystem = {inherit system;};
config = {
allowUnfree = true;
};
overlays = [ (_final: _prev: { inherit lib; }) ];
overlays = [(_final: _prev: {inherit lib;})];
};
devShells.default = pkgs.mkShell {
name = "nixos-shell";
@ -36,16 +32,15 @@
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") { };
srcs = self.callPackage (rootPath + "/_sources/generated.nix") {};
inherit (inputs'.nixvim.legacyPackages) makeNixvim makeNixvimWithModule;
neovim_git = inputs'.neovim-nightly.packages.default;
});
@ -57,20 +52,17 @@
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 [ ] (
flattenPkgs [] (
lib.removeAttrs self'.legacyPackages [
"inputs"
@ -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

@ -1 +1 @@
{ ... }: { }
{...}: {}

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,16 +20,15 @@ in
];
};
};
extraConfig =
let
extraConfig = let
output = node "output";
in
in [
(
output
["eDP-1"]
[
(output
[ "eDP-1" ]
[
(leaf "mode" [ "1920x1200@60.018" ])
(leaf "scale" [ 1.0 ])
(leaf "mode" ["1920x1200@60.018"])
(leaf "scale" [1.0])
(flag "focus-at-startup")
(leaf "position" [
{
@ -41,7 +36,7 @@ in
y = 0;
}
])
(leaf "transform" [ "normal" ])
(leaf "transform" ["normal"])
]
)
];

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,16 +1,16 @@
{ 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
[
(cfg.template // (cfg.helper.mkBacklight "ddcci13") // { output = "DP-1"; })
(cfg.template // (cfg.helper.mkBacklight "nvidia_0") // { output = "eDP-2"; })
in [
(cfg.template // (cfg.helper.mkBacklight "ddcci13") // {output = "DP-1";})
(cfg.template // (cfg.helper.mkBacklight "nvidia_0") // {output = "eDP-2";})
];
wluma.extraSettings = {
output = {
@ -34,6 +34,6 @@ in
}
];
};
extraConfig = [ ];
extraConfig = [];
};
}

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";
@ -26,7 +24,7 @@ in
]
)
// {
colors = lib.mkForce { };
colors = lib.mkForce {};
font.size = lib.mkForce 16;
window.opacity = lib.mkForce 0.8;
general.import = [

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";
@ -18,7 +16,7 @@ in
enable = true;
package = pkgs.espanso-wayland;
configs = {
default = { };
default = {};
};
matches = {
base = {

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";
@ -89,7 +87,7 @@ in
];
}
];
definedAliases = [ "@gp" ];
definedAliases = ["@gp"];
};
"Nix Packages" = {
urls = [
@ -108,7 +106,7 @@ in
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
definedAliases = ["@np"];
};
"Nix Options" = {
urls = [
@ -126,7 +124,7 @@ in
];
}
];
definedAliases = [ "@no" ];
definedAliases = ["@no"];
};
"Home Manager Options" = {
urls = [
@ -144,7 +142,7 @@ in
];
}
];
definedAliases = [ "@hm" ];
definedAliases = ["@hm"];
};
"Nix Flakes" = {
urls = [
@ -162,7 +160,7 @@ in
];
}
];
definedAliases = [ "@nf" ];
definedAliases = ["@nf"];
};
"NixOS Wiki" = {
urls = [
@ -176,7 +174,7 @@ in
];
}
];
definedAliases = [ "@nw" ];
definedAliases = ["@nw"];
};
"Rust Stdandard Lib" = {
urls = [
@ -190,7 +188,7 @@ in
];
}
];
definedAliases = [ "@rs" ];
definedAliases = ["@rs"];
};
"GitHub" = {
urls = [
@ -208,7 +206,7 @@ in
];
}
];
definedAliases = [ "@gh" ];
definedAliases = ["@gh"];
};
"Rust Reference" = {
urls = [
@ -222,7 +220,7 @@ in
];
}
];
definedAliases = [ "@rr" ];
definedAliases = ["@rr"];
};
"Rust Crates" = {
urls = [
@ -236,7 +234,7 @@ in
];
}
];
definedAliases = [ "@rc" ];
definedAliases = ["@rc"];
};
"C++ Reference" = {
urls = [
@ -254,7 +252,7 @@ in
];
}
];
definedAliases = [ "@cr" ];
definedAliases = ["@cr"];
};
"bing".metaData.hidden = true;
"google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias

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
@ -41,14 +41,13 @@ let
cliphist-fuzzel-img = getExe' pkgs.cliphist "cliphist-fuzzel-img";
wl-clip-persist = getExe pkgs.wl-clip-persist;
in
(
(
let
spawn = leaf "spawn";
in
[
in [
(plain "binds" [
(plain "Mod+V" [
(spawn [ cliphist-fuzzel-img ])
(spawn [cliphist-fuzzel-img])
])
(plain "Mod+Shift+P" [
(spawn [
@ -82,10 +81,11 @@ in
(flag "toggle-column-tabbed-display")
])
(plain "Mod+Space" [
(spawn [ fuzzel ])
(spawn [fuzzel])
])
(node "XF86AudioRaiseVolume"
[ { allow-when-locked = true; } ]
(
node "XF86AudioRaiseVolume"
[{allow-when-locked = true;}]
[
(spawn [
wpctl
@ -95,8 +95,9 @@ in
])
]
)
(node "XF86AudioLowerVolume"
[ { allow-when-locked = true; } ]
(
node "XF86AudioLowerVolume"
[{allow-when-locked = true;}]
[
(spawn [
wpctl
@ -106,8 +107,9 @@ in
])
]
)
(node "XF86AudioMute"
[ { allow-when-locked = true; } ]
(
node "XF86AudioMute"
[{allow-when-locked = true;}]
[
(spawn [
wpctl
@ -117,8 +119,9 @@ in
])
]
)
(node "XF86AudioMicMute"
[ { allow-when-locked = true; } ]
(
node "XF86AudioMicMute"
[{allow-when-locked = true;}]
[
(spawn [
wpctl
@ -131,8 +134,9 @@ in
(plain "Mod+Q" [
(flag "close-window")
])
(node "Mod+O"
[ { repeat = false; } ]
(
node "Mod+O"
[{repeat = false;}]
[
(flag "toggle-overview")
]
@ -281,14 +285,16 @@ in
(plain "Mod+Ctrl+I" [
(flag "move-workspace-up")
])
(node "Mod+Shift+WheelScrollDown"
[ { cooldown-ms = 150; } ]
(
node "Mod+Shift+WheelScrollDown"
[{cooldown-ms = 150;}]
[
(flag "focus-workspace-down")
]
)
(node "Mod+Shift+WheelScrollUp"
[ { cooldown-ms = 150; } ]
(
node "Mod+Shift+WheelScrollUp"
[{cooldown-ms = 150;}]
[
(flag "focus-workspace-up")
]
@ -300,58 +306,58 @@ in
(flag "focus-column-left")
])
(plain "Mod+1" [
(leaf "focus-workspace" [ 1 ])
(leaf "focus-workspace" [1])
])
(plain "Mod+2" [
(leaf "focus-workspace" [ 2 ])
(leaf "focus-workspace" [2])
])
(plain "Mod+3" [
(leaf "focus-workspace" [ 3 ])
(leaf "focus-workspace" [3])
])
(plain "Mod+4" [
(leaf "focus-workspace" [ 4 ])
(leaf "focus-workspace" [4])
])
(plain "Mod+5" [
(leaf "focus-workspace" [ 5 ])
(leaf "focus-workspace" [5])
])
(plain "Mod+6" [
(leaf "focus-workspace" [ 6 ])
(leaf "focus-workspace" [6])
])
(plain "Mod+7" [
(leaf "focus-workspace" [ 7 ])
(leaf "focus-workspace" [7])
])
(plain "Mod+8" [
(leaf "focus-workspace" [ 8 ])
(leaf "focus-workspace" [8])
])
(plain "Mod+9" [
(leaf "focus-workspace" [ 9 ])
(leaf "focus-workspace" [9])
])
(plain "Mod+Shift+1" [
(leaf "move-column-to-workspace" [ 1 ])
(leaf "move-column-to-workspace" [1])
])
(plain "Mod+Shift+2" [
(leaf "move-column-to-workspace" [ 2 ])
(leaf "move-column-to-workspace" [2])
])
(plain "Mod+Shift+3" [
(leaf "move-column-to-workspace" [ 3 ])
(leaf "move-column-to-workspace" [3])
])
(plain "Mod+Shift+4" [
(leaf "move-column-to-workspace" [ 4 ])
(leaf "move-column-to-workspace" [4])
])
(plain "Mod+Shift+5" [
(leaf "move-column-to-workspace" [ 5 ])
(leaf "move-column-to-workspace" [5])
])
(plain "Mod+Shift+6" [
(leaf "move-column-to-workspace" [ 6 ])
(leaf "move-column-to-workspace" [6])
])
(plain "Mod+Shift+7" [
(leaf "move-column-to-workspace" [ 7 ])
(leaf "move-column-to-workspace" [7])
])
(plain "Mod+Shift+8" [
(leaf "move-column-to-workspace" [ 8 ])
(leaf "move-column-to-workspace" [8])
])
(plain "Mod+Shift+9" [
(leaf "move-column-to-workspace" [ 9 ])
(leaf "move-column-to-workspace" [9])
])
(plain "Mod+F" [
(flag "toggle-window-floating")
@ -377,14 +383,16 @@ in
(plain "Mod+Period" [
(flag "expel-window-from-column")
])
(node "Mod+R"
[ { repeat = false; } ]
(
node "Mod+R"
[{repeat = false;}]
[
(flag "switch-preset-column-width")
]
)
(node "Mod+Shift+R"
[ { repeat = false; } ]
(
node "Mod+Shift+R"
[{repeat = false;}]
[
(flag "switch-preset-window-height")
]
@ -392,20 +400,23 @@ in
(plain "Mod+Ctrl+R" [
(flag "reset-window-height")
])
(node "Mod+M"
[ { repeat = false; } ]
(
node "Mod+M"
[{repeat = false;}]
[
(flag "maximize-column")
]
)
(node "Mod+Shift+M"
[ { repeat = false; } ]
(
node "Mod+Shift+M"
[{repeat = false;}]
[
(flag "fullscreen-window")
]
)
(node "Mod+Ctrl+M"
[ { repeat = false; } ]
(
node "Mod+Ctrl+M"
[{repeat = false;}]
[
(flag "maximize-window-to-edges")
]
@ -413,28 +424,32 @@ in
(plain "Mod+Z" [
(flag "center-column")
])
(node "Mod+Minus"
[ { repeat = false; } ]
(
node "Mod+Minus"
[{repeat = false;}]
[
(leaf "set-column-width" [ "-10%" ])
(leaf "set-column-width" ["-10%"])
]
)
(node "Mod+Equal"
[ { repeat = false; } ]
(
node "Mod+Equal"
[{repeat = false;}]
[
(leaf "set-column-width" [ "+10%" ])
(leaf "set-column-width" ["+10%"])
]
)
(node "Mod+Shift+Minus"
[ { repeat = false; } ]
(
node "Mod+Shift+Minus"
[{repeat = false;}]
[
(leaf "set-window-height" [ "-10%" ])
(leaf "set-window-height" ["-10%"])
]
)
(node "Mod+Shift+Equal"
[ { repeat = false; } ]
(
node "Mod+Shift+Equal"
[{repeat = false;}]
[
(leaf "set-window-height" [ "+10%" ])
(leaf "set-window-height" ["+10%"])
]
)
(plain "Print" [
@ -463,24 +478,23 @@ in
])
])
] # binds
)
++ (
)
++ (
let
spawn-at-startup = leaf "spawn-at-startup";
in
[
(leaf "screenshot-path" [ "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png" ])
in [
(leaf "screenshot-path" ["${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png"])
(plain "hotkey-overlay" [
(flag "skip-at-startup")
])
(flag "prefer-no-csd")
(spawn-at-startup [ waybar ])
(spawn-at-startup [ swaync ])
(spawn-at-startup [waybar])
(spawn-at-startup [swaync])
(spawn-at-startup [
waypaper
"--restore"
])
(spawn-at-startup [ polkit-kde-agent ])
(spawn-at-startup [polkit-kde-agent])
(spawn-at-startup [
wl-paste
"--watch"
@ -498,28 +512,28 @@ in
])
(plain "input" [
(plain "touchpad" [
(leaf "click-method" [ "clickfinger" ])
(leaf "click-method" ["clickfinger"])
(flag "dwt")
(leaf "scroll-method" [ "two-finger" ])
(leaf "tap-button-map" [ "left-right-middle" ])
(leaf "scroll-method" ["two-finger"])
(leaf "tap-button-map" ["left-right-middle"])
])
])
(plain "cursor" [
(leaf "hide-after-inactive-ms" [ 3000 ])
(leaf "hide-after-inactive-ms" [3000])
(flag "hide-when-typing")
])
(plain "layout" [
(leaf "background-color" [ "transparent" ])
(leaf "background-color" ["transparent"])
(plain "border" [
(flag "off")
(leaf "width" [ 4 ])
(leaf "active-color" [ "#7fc8ff" ])
(leaf "inactive-color" [ "#505050" ])
(leaf "width" [4])
(leaf "active-color" ["#7fc8ff"])
(leaf "inactive-color" ["#505050"])
])
(plain "focus-ring" [
# (flag "off")
(leaf "width" [ 4 ])
(leaf "active-color" [ "#7fc8ff" ])
(leaf "width" [4])
(leaf "active-color" ["#7fc8ff"])
(leaf "active-gradient" [
{
from = "#e00a54";
@ -527,27 +541,27 @@ in
angle = 45;
}
])
(leaf "inactive-color" [ "#505050" ])
(leaf "inactive-color" ["#505050"])
])
(plain "tab-indicator" [
(flag "hide-when-single-tab")
])
(plain "preset-column-widths" [
(leaf "proportion" [ (1. / 4.) ])
(leaf "proportion" [ (1. / 3.) ])
(leaf "proportion" [ (1. / 2.) ])
(leaf "proportion" [ (2. / 3.) ])
(leaf "proportion" [ (3. / 4.) ])
(leaf "proportion" [ (4. / 4.) ])
(leaf "proportion" [(1. / 4.)])
(leaf "proportion" [(1. / 3.)])
(leaf "proportion" [(1. / 2.)])
(leaf "proportion" [(2. / 3.)])
(leaf "proportion" [(3. / 4.)])
(leaf "proportion" [(4. / 4.)])
])
(flag "always-center-single-column")
(leaf "center-focused-column" [ "never" ])
(leaf "default-column-display" [ "tabbed" ])
(leaf "center-focused-column" ["never"])
(leaf "default-column-display" ["tabbed"])
(plain "default-column-width" [
(leaf "proportion" [ (1. / 2.) ])
(leaf "proportion" [(1. / 2.)])
])
(flag "empty-workspace-above-first")
(leaf "gaps" [ 16 ])
(leaf "gaps" [16])
])
(plain "animations" [
(plain "window-close" [
@ -566,60 +580,59 @@ in
])
])
] # others
)
++ (
)
++ (
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 ])
(leaf "clip-to-geometry" [ true ])
(leaf "draw-border-with-background" [true])
(leaf "geometry-corner-radius" [0.0])
(leaf "clip-to-geometry" [true])
])
(window-rule [
(match [ { app-id = "^org\\.keepassxc\\.KeePassXC$"; } ])
(match [ { app-id = "^org\\.gnome\\.World\\.Secrets$"; } ])
(leaf "block-out-from" [ "screen-capture" ])
(match [{app-id = "^org\\.keepassxc\\.KeePassXC$";}])
(match [{app-id = "^org\\.gnome\\.World\\.Secrets$";}])
(leaf "block-out-from" ["screen-capture"])
])
(window-rule [
(match [ { is-active = true; } ])
(leaf "opacity" [ 1.0 ])
(match [{is-active = true;}])
(leaf "opacity" [1.0])
])
(window-rule [
(match [ { is-active = false; } ])
(leaf "opacity" [ 0.8 ])
(leaf "draw-border-with-background" [ false ])
(match [{is-active = false;}])
(leaf "opacity" [0.8])
(leaf "draw-border-with-background" [false])
])
(window-rule [
(match [ { app-id = "^Alacritty$"; } ])
(match [ { app-id = "^com\\.mitchellh\\.ghostty$"; } ])
(match [ { app-id = "^neovide$"; } ])
(leaf "draw-border-with-background" [ false ])
(match [{app-id = "^Alacritty$";}])
(match [{app-id = "^com\\.mitchellh\\.ghostty$";}])
(match [{app-id = "^neovide$";}])
(leaf "draw-border-with-background" [false])
])
(window-rule [
(match [ { app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$"; } ])
(leaf "open-floating" [ true ])
(match [{app-id = "^org\\.kde\\.polkit-kde-authentication-agent-1$";}])
(leaf "open-floating" [true])
])
(window-rule [
(match [ { app-id = "^swayimg$"; } ])
(leaf "draw-border-with-background" [ false ])
(leaf "open-floating" [ true ])
(match [{app-id = "^swayimg$";}])
(leaf "draw-border-with-background" [false])
(leaf "open-floating" [true])
])
(window-rule [
(match [ { is-window-cast-target = true; } ])
(match [{is-window-cast-target = true;}])
(plain "focus-ring" [
(leaf "active-color" [ "#f38ba8" ])
(leaf "inactive-color" [ "#7d0d2d" ])
(leaf "active-color" ["#f38ba8"])
(leaf "inactive-color" ["#7d0d2d"])
])
(plain "border" [
(leaf "active-color" [ "#f38ba8" ])
(leaf "inactive-color" [ "#7d0d2d" ])
(leaf "active-color" ["#f38ba8"])
(leaf "inactive-color" ["#7d0d2d"])
])
(plain "tab-indicator" [
(leaf "active-color" [ "#f38ba8" ])
(leaf "inactive-color" [ "#7d0d2d" ])
(leaf "active-color" ["#f38ba8"])
(leaf "inactive-color" ["#7d0d2d"])
])
(plain "shadow" [
(flag "on")
@ -638,8 +651,8 @@ in
title = "";
}
])
(leaf "open-floating" [ true ])
(leaf "open-fullscreen" [ false ])
(leaf "open-floating" [true])
(leaf "open-fullscreen" [false])
])
(window-rule [
(match [
@ -648,7 +661,7 @@ in
title = "^wechat$";
}
])
(leaf "open-focused" [ false ])
(leaf "open-focused" [false])
])
(window-rule [
(match [
@ -657,8 +670,8 @@ in
title = "^notificationtoasts_\\d+_desktop$";
}
])
(leaf "open-floating" [ true ])
(leaf "open-focused" [ false ])
(leaf "open-floating" [true])
(leaf "open-focused" [false])
(leaf "default-floating-position" [
{
x = 10;
@ -666,31 +679,30 @@ in
"relative-to" = "bottom-right";
}
])
(leaf "clip-to-geometry" [ false ])
(leaf "clip-to-geometry" [false])
])
] # window-rule
)
++ (
)
++ (
let
layer-rule = plain "layer-rule";
match = leaf "match";
in
[
in [
(layer-rule [
(match [ { namespace = "^swaync-notification-window$"; } ])
(match [ { namespace = "^swaync-control-center$"; } ])
(leaf "block-out-from" [ "screen-capture" ])
(match [{namespace = "^swaync-notification-window$";}])
(match [{namespace = "^swaync-control-center$";}])
(leaf "block-out-from" ["screen-capture"])
])
(layer-rule [
(match [ { namespace = "^launcher$"; } ])
(match [{namespace = "^launcher$";}])
(plain "shadow" [
(flag "on")
])
(leaf "geometry-corner-radius" [ 10.0 ])
(leaf "geometry-corner-radius" [10.0])
])
(layer-rule [
(match [ { namespace = "^mpvpaper$"; } ])
(leaf "place-within-backdrop" [ true ])
(match [{namespace = "^mpvpaper$";}])
(leaf "place-within-backdrop" [true])
])
] # layer-rule
)
)

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 {
@ -51,28 +51,27 @@ in
swayimg
seahorse
])
++ [ niri ];
++ [niri];
qt = {
enable = true;
};
xdg.portal = {
configPackages = [ niri ];
configPackages = [niri];
enable = true;
extraPortals = lib.mkIf (
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
) [ pkgs.xdg-desktop-portal-gnome ];
) [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;
};
@ -97,7 +96,7 @@ in
};
programs.niri = {
config =
(lib.toList (import ./config.nix (args // { inherit pkgs; }))) ++ (lib.toList cfg.extraConfig);
(lib.toList (import ./config.nix (args // {inherit pkgs;}))) ++ (lib.toList cfg.extraConfig);
package = niri;
};
})

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";
@ -49,7 +47,7 @@ in
};
})
(lib.mkIf (cfg.enable && config.youthlic.programs.sops.enable) {
programs.ssh.includes = [ config.sops.secrets.ssh-config.path ];
programs.ssh.includes = [config.sops.secrets.ssh-config.path];
sops.secrets = {
"ssh-private-key/tytonidae" = {
mode = "0600";

View file

@ -4,17 +4,15 @@
lib,
inputs,
...
}:
let
}: let
inherit (inputs) nixpkgs emacs-overlay spacemacs;
inherit (pkgs) system;
cfg = config.david.programs.spacemacs;
pkgs' = import nixpkgs {
localSystem = { inherit system; };
overlays = [ emacs-overlay.overlays.default ];
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";
@ -20,7 +18,7 @@ in
};
})
(lib.mkIf (!cfg.systemd.enable) {
systemd.user.services.swaync = lib.mkForce { };
systemd.user.services.swaync = lib.mkForce {};
})
];
}

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";
@ -25,7 +23,7 @@ in
"niri/workspaces"
"wlr/taskbar"
];
modules-center = [ "clock" ];
modules-center = ["clock"];
modules-right = [
"tray"
"idle_inhibitor"
@ -39,7 +37,7 @@ in
on-click = "activate";
};
"niri/worksapces" = { };
"niri/worksapces" = {};
"niri/taskbar" = {
icon-size = 15;
on-click = "activate";

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";
@ -29,7 +27,7 @@ in
OnCalendar = "*:0/10";
};
Install = {
WantedBy = [ "timers.target" ];
WantedBy = ["timers.target"];
};
};
services."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";
@ -64,7 +62,7 @@ in
ty = {
binary = {
path = lib.getExe pkgs.ty;
arguments = [ "server" ];
arguments = ["server"];
};
};
};

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";
@ -18,7 +16,7 @@ in
};
};
config = lib.mkIf cfg.enable {
sops.secrets."awscli" = { };
sops.secrets."awscli" = {};
programs.awscli = {
enable = true;
credentials = {

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,26 +3,23 @@
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 {
type = lib.types.listOf (lib.types.either lib.types.str lib.types.anything);
default = [ "typos-lsp" ];
example = [ "rust-analyzer" ];
default = ["typos-lsp"];
example = ["rust-analyzer"];
apply = lib.unique;
};
};
@ -30,17 +27,16 @@ in
)
);
default = lib.pipe defaultLanguagesSettings [
(map (lang: lib.nameValuePair lang.name (lib.removeAttrs lang [ "name" ])))
(map (lang: lib.nameValuePair lang.name (lib.removeAttrs lang ["name"])))
lib.listToAttrs
];
apply = lib.mapAttrsToList (name: value: { inherit name; } // value);
apply = lib.mapAttrsToList (name: value: {inherit name;} // value);
};
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
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
@ -86,12 +81,12 @@ in
command = "typos-lsp";
};
};
} { language = cfg.languageSettings; };
} {language = cfg.languageSettings;};
};
})
(lib.mkIf cfg.enable {
youthlic.programs.helix.languageSettings = lib.pipe defaultLanguagesSettings [
(map ({ name, ... }: lib.nameValuePair name { language-servers = [ "typos-lsp" ]; }))
(map ({name, ...}: lib.nameValuePair name {language-servers = ["typos-lsp"];}))
lib.listToAttrs
];
})
@ -99,7 +94,7 @@ in
youthlic.programs.helix.languageSettings =
lib.recursiveUpdate
(lib.pipe defaultLanguagesSettings [
(map (lang: lib.nameValuePair lang.name (lib.removeAttrs lang [ "name" ])))
(map (lang: lib.nameValuePair lang.name (lib.removeAttrs lang ["name"])))
lib.listToAttrs
])
{

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";
@ -16,8 +14,8 @@ in
dconf = {
settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
};

View file

@ -3,22 +3,20 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.youthlic.programs.rustypaste-cli;
in
{
in {
options = {
youthlic.programs.rustypaste-cli = {
enable = lib.mkEnableOption "rustypaste-cli";
};
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.rustypaste-cli ];
home.packages = [pkgs.rustypaste-cli];
sops = {
secrets = {
"rustypaste/auth" = { };
"rustypaste/delete" = { };
"rustypaste/auth" = {};
"rustypaste/delete" = {};
};
templates."rustypaste-config.toml" = {
path = "${config.xdg.configHome}/rustypaste/config.toml";

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
@ -81,7 +80,7 @@ in
desc = "Chmod on selected files";
}
{
on = [ "l" ];
on = ["l"];
run = "plugin smart-enter";
desc = "Enter the child directory, or open the file";
}

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
@ -76,11 +75,11 @@
kernelPackages = pkgs.linuxPackages_cachyos;
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelParams = [ "i915.enable_guc=2" ];
kernelParams = ["i915.enable_guc=2"];
};
nix = {
settings = {
system-features = [ "gccarch-skylake" ];
system-features = ["gccarch-skylake"];
};
};
hardware = {

View file

@ -49,7 +49,7 @@
];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
extraArgs = ["-f"];
subvolumes = {
"@root" = {
mountpoint = "/";

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")
];
@ -21,9 +20,9 @@
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

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 ./.);
@ -72,7 +72,7 @@
};
nix = {
settings = {
system-features = [ "gccarch-ivybridge" ];
system-features = ["gccarch-ivybridge"];
};
};

View file

@ -15,7 +15,7 @@
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
extraArgs = ["-f"];
subvolumes = {
"@root" = {
mountpoint = "/";

View file

@ -1,12 +1,11 @@
{ config, ... }:
{
{config, ...}: {
youthlic.containers.forgejo = {
enable = true;
domain = "forgejo.youthlic.social";
sshPort = 2222;
httpPort = 8480;
};
networking.firewall.allowedTCPPorts = [ 2222 ];
networking.firewall.allowedTCPPorts = [2222];
services.caddy.virtualHosts = {
"forgejo.${config.youthlic.programs.caddy.baseDomain}" = {
extraConfig = ''

View file

@ -7,8 +7,7 @@
pkgs,
modulesPath,
...
}:
{
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
@ -20,9 +19,9 @@
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

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,6 +1,5 @@
{ config, ... }:
{
sops.secrets."ssh-private-key/radicle/Cape" = { };
{config, ...}: {
sops.secrets."ssh-private-key/radicle/Cape" = {};
youthlic.programs.radicle = {
enable = true;
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbQrJNWcWsFncTX4w/hkhz6zPNwHrTjA+6lnq5dmu/s radicle";

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
@ -18,7 +17,7 @@
++ (with outputs; [
nixosModules.gui
])
++ [ inputs.lanzaboote.nixosModules.lanzaboote ]
++ [inputs.lanzaboote.nixosModules.lanzaboote]
++ (lib.youthlic.loadImports ./.);
youthlic = {

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")
];
@ -20,9 +19,9 @@
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -3,8 +3,7 @@
lib,
config,
...
}:
{
}: {
nixpkgs.config.cudaSupport = true;
services = {
hardware.bolt.enable = true;
@ -16,13 +15,13 @@
};
nix = {
settings = {
system-features = [ "gccarch-alderlake" ];
system-features = ["gccarch-alderlake"];
};
};
hardware = {
openrazer = {
enable = true;
users = [ "david" ];
users = ["david"];
};
graphics.package = pkgs.mesa_git;
intelgpu = {
@ -40,7 +39,7 @@
};
};
boot = {
extraModulePackages = with config.boot.kernelPackages; [ ddcci-driver ];
extraModulePackages = with config.boot.kernelPackages; [ddcci-driver];
kernelModules = [
"ddcci"
"ddcci-backlight"
@ -56,13 +55,12 @@
};
systemd.services."ddcci@" = {
description = "ddcci handler";
after = [ "graphical.target" ];
before = [ "shutdown.target" ];
conflicts = [ "shutdown.target" ];
after = ["graphical.target"];
before = ["shutdown.target"];
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,12 +2,11 @@
inputs,
lib,
...
}:
{
}: {
config.specialisation.niri-hybrid = {
inheritParentConfig = true;
configuration = {
imports = [ inputs.nixos-hardware.nixosModules.common-gpu-nvidia ];
imports = [inputs.nixos-hardware.nixosModules.common-gpu-nvidia];
hardware.nvidia.prime.reverseSync.enable = lib.mkForce 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.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
@ -90,10 +86,10 @@ in
};
systemd.services.forgejo = {
wants = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
wantedBy = [ "default.target" ];
wants = ["postgresql.service"];
requires = ["postgresql.service"];
after = ["postgresql.service"];
wantedBy = ["default.target"];
};
networking = {

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
@ -71,18 +67,18 @@ in
};
systemd.services.miniflux = {
wants = [ "postgresql.service" ];
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
wantedBy = [ "default.target" ];
wants = ["postgresql.service"];
requires = ["postgresql.service"];
after = ["postgresql.service"];
wantedBy = ["default.target"];
};
networking = {
defaultGateway = "192.168.111.1";
firewall = {
enable = true;
allowedTCPPorts = [ 8485 ];
allowedUDPPorts = [ 8485 ];
allowedTCPPorts = [8485];
allowedUDPPorts = [8485];
};
useHostResolvConf = lib.mkForce false;
};

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,15 +21,14 @@ 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" = {
requires = [ "sysinit-reactivation.target" ];
after = [ "sysinit-reactivation.target" ];
partOf = [ "sysinit-reactivation.target" ];
wantedBy = [ "default.target" ];
requires = ["sysinit-reactivation.target"];
after = ["sysinit-reactivation.target"];
partOf = ["sysinit-reactivation.target"];
wantedBy = ["default.target"];
path = [
cfg.package
pkgs.gawk

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";

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