chore(linter/formatter): Apply linter and formatter

This commit is contained in:
DashieTM 2025-09-06 16:18:00 +02:00
parent aefd89f89d
commit 68d16b8212
24 changed files with 469 additions and 448 deletions

33
.github/workflows/pr.yaml vendored Normal file
View file

@ -0,0 +1,33 @@
# inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
name: Rust-build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
name: Build
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-experimental-features = nix-command flakes
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: action
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: cache
uses: cachix/cachix-action@v16
with:
name: dashnix
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Linter check
run: nix -L build github:${{ github.repository }}/${{ github.sha }} --no-write-lock-file

View file

@ -20,8 +20,8 @@
pathToAttrs = path: pathToAttrs = path:
lib.attrsets.mapAttrsToList ( lib.attrsets.mapAttrsToList (
name: meta: { name: meta: {
name = name; inherit name;
meta = meta; inherit meta;
} }
) )
(builtins.readDir path); (builtins.readDir path);

View file

@ -13,7 +13,7 @@
}; };
}; };
outputs = {...} @ inputs: { outputs = inputs: {
nixosConfigurations = inputs.dashNix.dashNixLib.buildSystems {root = ./.;}; nixosConfigurations = inputs.dashNix.dashNixLib.buildSystems {root = ./.;};
}; };

View file

@ -30,9 +30,6 @@
zen-browser.url = "github:youwen5/zen-browser-flake"; zen-browser.url = "github:youwen5/zen-browser-flake";
# TODO move to upstream repository after merged nix flake pr
fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
base16.url = "github:SenchoPens/base16.nix"; base16.url = "github:SenchoPens/base16.nix";
disko.url = "github:nix-community/disko/latest"; disko.url = "github:nix-community/disko/latest";
@ -44,6 +41,7 @@
oxidash.url = "github:Xetibo/OxiDash"; oxidash.url = "github:Xetibo/OxiDash";
oxipaste.url = "github:Xetibo/OxiPaste"; oxipaste.url = "github:Xetibo/OxiPaste";
oxirun.url = "github:Xetibo/OxiRun"; oxirun.url = "github:Xetibo/OxiRun";
dashvim.url = "github:Xetibo/DashVim";
# For now until merged into Xetibo # For now until merged into Xetibo
hyprdock.url = "github:Xetibo/hyprdock"; hyprdock.url = "github:Xetibo/hyprdock";
reset.url = "github:Xetibo/ReSet"; reset.url = "github:Xetibo/ReSet";
@ -53,10 +51,6 @@
# absolute insanity # absolute insanity
chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
dashvim = {
url = "github:Xetibo/DashVim";
};
}; };
outputs = {self, ...} @ inputs: let outputs = {self, ...} @ inputs: let
@ -109,9 +103,11 @@
inherit inputs; inherit inputs;
pkgs = unstable; pkgs = unstable;
system = currentSystem; system = currentSystem;
lib = inputs.unstable.lib; inherit (inputs.unstable) lib;
buildSystems = dashNixLib.buildSystems; inherit (dashNixLib) buildSystems;
}; };
lint = unstable.statix;
format = unstable.alejandra;
dashNixInputs = inputs; dashNixInputs = inputs;
stablePkgs = stable; stablePkgs = stable;
unstablePkgs = unstable; unstablePkgs = unstable;

View file

@ -15,8 +15,7 @@
in in
lib.mkIf config.mods.nextcloud.enable { lib.mkIf config.mods.nextcloud.enable {
systemd.user = { systemd.user = {
services = ( services = builtins.listToAttrs (
builtins.listToAttrs (
map (opts: { map (opts: {
name = "${opts.name}"; name = "${opts.name}";
value = { value = {
@ -35,10 +34,8 @@ in
}; };
}) })
synclist synclist
)
); );
timers = ( timers = builtins.listToAttrs (
builtins.listToAttrs (
map (opts: { map (opts: {
name = "${opts.name}"; name = "${opts.name}";
value = { value = {
@ -52,7 +49,6 @@ in
}; };
}) })
synclist synclist
)
); );
startServices = true; startServices = true;
}; };

View file

@ -319,11 +319,9 @@
else {} else {}
); );
moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {}; moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {};
mkFirefoxTheme = ( mkFirefoxTheme = profiles:
profiles:
profiles profiles
|> profileNamesFn |> profileNamesFn
|> chromesFn |> chromesFn
|> moduleFn |> moduleFn;
);
in {home.file = mkFirefoxTheme profiles;} in {home.file = mkFirefoxTheme profiles;}

View file

@ -65,16 +65,16 @@ in {
# legacy compatibility # legacy compatibility
name = scheme.scheme; name = scheme.scheme;
base00 = scheme.base00; inherit (scheme) base00;
base01 = scheme.base01; inherit (scheme) base01;
base02 = scheme.base02; inherit (scheme) base02;
base03 = scheme.base03; inherit (scheme) base03;
base04 = scheme.base04; inherit (scheme) base04;
base05 = scheme.base05; inherit (scheme) base05;
base06 = scheme.base06; inherit (scheme) base06;
base07 = scheme.base07; inherit (scheme) base07;
base08 = scheme.base08; inherit (scheme) base08;
base09 = scheme.base09; inherit (scheme) base09;
base0a = scheme.base0A; base0a = scheme.base0A;
base0b = scheme.base0B; base0b = scheme.base0B;
base0c = scheme.base0C; base0c = scheme.base0C;

View file

@ -31,15 +31,6 @@
} }
''; '';
in { in {
xdg.configFile."qt5ct/colors/tokyonight.conf" = {
text = "${color}";
};
xdg.configFile."qt6ct/colors/tokyonight.conf" = {
text = "${color}";
};
xdg.configFile."qt5ct/qss/tab.qss" = {
text = "${qss}";
};
stylix.targets.qt = { stylix.targets.qt = {
enable = false; enable = false;
}; };
@ -49,7 +40,17 @@ in {
style.name = lib.mkForce "breeze-dark"; style.name = lib.mkForce "breeze-dark";
}; };
xdg.configFile."qt5ct/qt5ct.conf" = { xdg.configFile = {
"qt5ct/colors/tokyonight.conf" = {
text = "${color}";
};
"qt6ct/colors/tokyonight.conf" = {
text = "${color}";
};
"qt5ct/qss/tab.qss" = {
text = "${qss}";
};
"qt5ct/qt5ct.conf" = {
text = '' text = ''
[Appearance] [Appearance]
@ -86,7 +87,7 @@ in {
ignored_applications=@Invalid() ignored_applications=@Invalid()
''; '';
}; };
xdg.configFile."qt6ct/qt6ct.conf" = { "qt6ct/qt6ct.conf" = {
text = '' text = ''
[Appearance] [Appearance]
@ -119,4 +120,5 @@ in {
ignored_applications=@Invalid() ignored_applications=@Invalid()
''; '';
}; };
};
} }

View file

@ -10,7 +10,7 @@
in { in {
imports = ["${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"]; imports = ["${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"];
nixpkgs.hostPlatform = { nixpkgs.hostPlatform = {
system = system; inherit system;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -70,7 +70,6 @@
inputs.reset.homeManagerModules.default inputs.reset.homeManagerModules.default
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.dashvim.homeManagerModules.dashvim inputs.dashvim.homeManagerModules.dashvim
inputs.fancontrol.homeManagerModules.default
inputs.chaoticNyx.homeManagerModules.default inputs.chaoticNyx.homeManagerModules.default
../modules ../modules
]; ];
@ -82,7 +81,7 @@
builtins.listToAttrs ( builtins.listToAttrs (
map map
(name: { (name: {
name = name; inherit name;
value = let value = let
mod = root + /hosts/${name}/configuration.nix; mod = root + /hosts/${name}/configuration.nix;
additionalNixosConfig = root + /hosts/${name}/hardware.nix; additionalNixosConfig = root + /hosts/${name}/hardware.nix;

View file

@ -105,7 +105,7 @@ in {
// { // {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.firefox.extensions ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.firefox.extensions
++ ( ++ (
if (config.mods.browser.firefox.darkreader) if config.mods.browser.firefox.darkreader
then [ then [
{ {
"addon@darkreader.org" = { "addon@darkreader.org" = {

View file

@ -99,7 +99,7 @@ in {
// { // {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.librewolf.extensions ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.librewolf.extensions
++ ( ++ (
if (config.mods.browser.firefox.darkreader) if config.mods.browser.firefox.darkreader
then [ then [
{ {
"addon@darkreader.org" = { "addon@darkreader.org" = {

View file

@ -134,7 +134,7 @@ in {
// { // {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.zen.extensions ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.zen.extensions
++ ( ++ (
if (config.mods.browser.firefox.darkreader) if config.mods.browser.firefox.darkreader
then [ then [
{ {
"addon@darkreader.org" = { "addon@darkreader.org" = {

View file

@ -517,29 +517,31 @@ in {
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim { programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true; enable = true;
colorscheme = config.mods.stylix.colorscheme; inherit (config.mods.stylix) colorscheme;
}; };
programs.vscode = lib.mkIf config.mods.coding.vscodium.enable { programs.vscode = lib.mkIf config.mods.coding.vscodium.enable {
enable = true; enable = true;
package = mkDashDefault pkgs.vscodium; package = mkDashDefault pkgs.vscodium;
profiles.default.extensions = config.mods.coding.vscodium.extensions; profiles.default.extensions = config.mods.coding.vscodium.extensions;
}; };
xdg.configFile."neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) { xdg.configFile = {
"neovide/config.toml" = lib.mkIf (config.mods.coding.dashvim || config.mods.coding.neovide.enable) {
source = source =
(pkgs.formats.toml {}).generate "neovide" (pkgs.formats.toml {}).generate "neovide"
config.mods.coding.neovide.config; config.mods.coding.neovide.config;
}; };
xdg.configFile."gh/config.yml" = lib.mkIf config.mods.coding.gh.enable { "gh/config.yml" = lib.mkIf config.mods.coding.gh.enable {
source = source =
(pkgs.formats.yaml {}).generate "config" (pkgs.formats.yaml {}).generate "config"
config.mods.coding.gh.config; config.mods.coding.gh.config;
}; };
xdg.configFile."gh/hosts.yml" = lib.mkIf config.mods.coding.gh.enable { "gh/hosts.yml" = lib.mkIf config.mods.coding.gh.enable {
source = source =
(pkgs.formats.yaml {}).generate "hosts" (pkgs.formats.yaml {}).generate "hosts"
config.mods.coding.gh.hosts; config.mods.coding.gh.hosts;
}; };
};
home.packages = with pkgs; home.packages = with pkgs;
[ [

View file

@ -43,8 +43,7 @@
description = "Container packages"; description = "Container packages";
}; };
}; };
config = ( config = lib.optionalAttrs (options ? environment.systemPackages) {
lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = environment.systemPackages =
(lib.lists.optionals ( (lib.lists.optionals (
config.mods.containers.variant == "podman" config.mods.containers.variant == "podman"
@ -76,6 +75,5 @@
}; };
} }
else {}; else {};
} };
);
} }

View file

@ -159,8 +159,7 @@
}; };
}; };
config = ( config = lib.optionalAttrs (options ? fileSystems) {
lib.optionalAttrs (options ? fileSystems) {
boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) ( boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) (
builtins.listToAttrs ( builtins.listToAttrs (
map ( map (
@ -309,6 +308,5 @@
config.mods.drives.extraDrives config.mods.drives.extraDrives
); );
}; };
} };
);
} }

View file

@ -1,5 +1,6 @@
{ {
lib, lib,
pkgs,
config, config,
options, options,
... ...
@ -20,7 +21,7 @@
}; };
config = lib.mkIf config.mods.fancontrol.enable ( config = lib.mkIf config.mods.fancontrol.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.fancontrol-gui.enable = true; home.packages = [pkgs.fancontrol-gui];
} }
// (lib.optionalAttrs (options ? boot.kernelModules) { // (lib.optionalAttrs (options ? boot.kernelModules) {
boot = { boot = {

View file

@ -56,7 +56,7 @@
}; };
config = lib.optionalAttrs (options ? home.packages) { config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch.enable) { xdg.configFile."fastfetch/config.jsonc" = lib.mkIf config.mods.dashfetch.enable {
source = source =
(pkgs.formats.json {}).generate "config.jsonc" (pkgs.formats.json {}).generate "config.jsonc"
{ {

View file

@ -47,8 +47,7 @@
description = "ssh configuration (keys for git)"; description = "ssh configuration (keys for git)";
}; };
}; };
config = ( config = lib.optionalAttrs (options ? programs.git && options ? home.file) {
lib.optionalAttrs (options ? programs.git && options ? home.file) {
programs.git = { programs.git = {
enable = true; enable = true;
userName = config.mods.git.username; userName = config.mods.git.username;
@ -56,6 +55,5 @@
extraConfig = config.mods.git.additionalConfig; extraConfig = config.mods.git.additionalConfig;
}; };
home.file.".ssh/config".text = config.mods.git.sshConfig; home.file.".ssh/config".text = config.mods.git.sshConfig;
} };
);
} }

View file

@ -130,9 +130,13 @@
''; '';
# unlock GPG keyring on login # unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = mkDashDefault true; security.pam = {
security.pam.services.greetd.sshAgentAuth = mkDashDefault true; services.greetd = {
security.pam.sshAgentAuth.enable = mkDashDefault true; enableGnomeKeyring = mkDashDefault true;
sshAgentAuth = mkDashDefault true;
};
sshAgentAuth.enable = mkDashDefault true;
};
} }
// lib.optionalAttrs (options ? home) { // lib.optionalAttrs (options ? home) {
xdg.configFile."regreet/regreet.toml".source = xdg.configFile."regreet/regreet.toml".source =

View file

@ -24,8 +24,7 @@
description = "More scripts to be passed. (check existing ones for types and examples)"; description = "More scripts to be passed. (check existing ones for types and examples)";
}; };
}; };
config = ( config = lib.optionalAttrs (options ? home.packages) {
lib.optionalAttrs (options ? home.packages) {
home.packages = home.packages =
[ [
(lib.mkIf config.mods.scripts.changeBrightness ( (lib.mkIf config.mods.scripts.changeBrightness (
@ -120,6 +119,5 @@
)) ))
] ]
++ config.mods.scripts.scripts; ++ config.mods.scripts.scripts;
} };
);
} }

View file

@ -23,7 +23,7 @@ in {
}; };
config = lib.mkIf config.mods.teams.enable ( config = lib.mkIf config.mods.teams.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = [(callPackage ../../override/teams.nix {chromium = pkgs.chromium;})]; home.packages = [(callPackage ../../override/teams.nix {inherit (pkgs) chromium;})];
} }
// (lib.optionalAttrs (options ? boot.kernelModules) { // (lib.optionalAttrs (options ? boot.kernelModules) {
boot = { boot = {

View file

@ -18,13 +18,11 @@
description = "Your variant"; description = "Your variant";
}; };
}; };
config = ( config = lib.optionalAttrs (options ? services.xserver) {
lib.optionalAttrs (options ? services.xserver) {
# Configure keymap in X11 # Configure keymap in X11
services.xserver = { services.xserver = {
xkb.layout = "${config.mods.xkb.layout}"; xkb.layout = "${config.mods.xkb.layout}";
xkb.variant = "${config.mods.xkb.variant}"; xkb.variant = "${config.mods.xkb.variant}";
}; };
} };
);
} }

View file

@ -52,7 +52,7 @@
lib.mkIf config.mods.yazi.enable { lib.mkIf config.mods.yazi.enable {
home.packages = [pkgs.glow]; home.packages = [pkgs.glow];
programs.yazi = { programs.yazi = {
enable = conf.enable; inherit (conf) enable;
settings = conf.settings // config.mods.yazi.additionalKeymap; settings = conf.settings // config.mods.yazi.additionalKeymap;
keymap = conf.keymap // config.mods.yazi.additionalConfig; keymap = conf.keymap // config.mods.yazi.additionalConfig;
plugins = config.mods.yazi.plugins; plugins = config.mods.yazi.plugins;