Use alejandra formatter / fix warnings

This commit is contained in:
DashieTM 2025-02-15 16:23:22 +01:00
parent c5b1041bbb
commit 693d4e3c70
70 changed files with 1424 additions and 1547 deletions

View file

@ -5,12 +5,13 @@
hostName,
modulesPath,
...
}:
let
}: let
username = config.conf.username;
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
#(modulesPath + "/misc/nixpkgs/read-only.nix")
];
# Bootloader.
boot = {
@ -34,11 +35,13 @@ in
"sd_mod"
];
};
kernelParams = [
kernelParams =
[
''resume="PARTLABEL=SWAP"''
''quiet''
''udev.log_level=3''
] ++ config.conf.bootParams;
]
++ config.conf.bootParams;
};
# Enable networking
@ -59,6 +62,8 @@ in
flatpak.enable = true;
xserver.enable = true;
fstrim.enable = lib.mkDefault true;
# Enable sound with pipewire.
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa = {
@ -85,9 +90,7 @@ in
};
};
# Enable sound with pipewire.
hardware = {
pulseaudio.enable = false;
cpu.${config.conf.cpu}.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
};
@ -124,5 +127,4 @@ in
password = "firstlogin";
};
};
}

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
environment = {
variables = {
GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
layout = pkgs.writeText "dashie" ''
xkb_symbols "dashie"
{
@ -10,8 +9,7 @@ let
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
};
'';
in
{
in {
environment.systemPackages = [pkgs.xorg.xkbcomp];
services.xserver.xkb.extraLayouts.dashie = {
description = "US layout with 'umlaut'";

View file

@ -4,8 +4,7 @@
build_systems,
lib,
...
}:
let
}: let
makeOptionsDoc = configuration: pkgs.nixosOptionsDoc {options = configuration;};
generateDocs = obj: ''
touch src/${obj.fst}.md

View file

@ -21,9 +21,7 @@
};
};
outputs =
{ ... }@inputs:
{
outputs = {...} @ inputs: {
nixosConfigurations = inputs.dashNix.dashNixLib.build_systems {root = ./.;};
};

View file

@ -1,5 +1,4 @@
{ config, ... }:
{
{config, ...}: {
# variables for system
# TODO important changes
conf = {

View file

@ -48,9 +48,7 @@
};
};
outputs =
{ self, ... }@inputs:
let
outputs = {self, ...} @ inputs: let
permittedPackages = [
"olm-3.2.16"
# well done dotnet...
@ -73,7 +71,6 @@
system = "x86_64-linux";
config = {
allowUnfree = true;
allowBroken = true;
permittedInsecurePackages = permittedPackages;
};
};
@ -86,8 +83,7 @@
allowUnfree = true;
};
};
in
rec {
in rec {
dashNixLib = import ./lib {
inherit
self

View file

@ -2,11 +2,9 @@
config,
lib,
...
}:
let
}: let
username = config.conf.username;
in
{
in {
manual = {
html.enable = false;
json.enable = false;

View file

@ -1,17 +1,16 @@
{
inputs,
pkgs,
config,
lib,
mod,
additionalHomeConfig,
homeMods,
additionalHomeMods,
additionalInputs,
config,
homeMods,
inputs,
lib,
mod,
pkgs,
root,
...
}:
{
}: {
xdg = {
portal.config.common.default = "*";
portal = {

View file

@ -4,11 +4,12 @@
pkgs,
lib,
...
}:
let
}: let
username = config.mods.nextcloud.username;
password =
if (config.sops.secrets ? nextcloud.path) then config.sops.secrets.nextcloud.path else "";
if (config.sops.secrets ? nextcloud.path)
then config.sops.secrets.nextcloud.path
else "";
url = config.mods.nextcloud.url;
synclist = config.mods.nextcloud.synclist;
in
@ -32,7 +33,8 @@ lib.mkIf config.mods.nextcloud.enable {
};
Install.WantedBy = ["multi-user.target"];
};
}) synclist
})
synclist
)
);
timers = (
@ -48,7 +50,8 @@ lib.mkIf config.mods.nextcloud.enable {
"timers.target"
];
};
}) synclist
})
synclist
)
);
startServices = true;

View file

@ -6,19 +6,16 @@
lib,
inputs,
...
}:
let
}: let
base16 = pkgs.callPackage inputs.base16.lib {};
baseScheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
power =
number: powerIndex:
if powerIndex == 1 then
number
else if powerIndex == 0 then
1
else
number * power number (powerIndex - 1);
baseScheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
power = number: powerIndex:
if powerIndex == 1
then number
else if powerIndex == 0
then 1
else number * power number (powerIndex - 1);
lookupTable = powerIndex: {
"0" = 0 * (power 16 powerIndex);
@ -39,16 +36,14 @@ let
"f" = 15 * (power 16 powerIndex);
};
convertHex =
hexChars:
convertHex = hexChars:
recombineColors [
(convertColor (lib.lists.take 2 hexChars))
(convertColor (lib.lists.take 2 (lib.lists.drop 2 hexChars)))
(convertColor (lib.lists.take 2 (lib.lists.drop 4 hexChars)))
];
convertColor =
color: (lookupTable 1).${(lib.lists.head color)} + (lookupTable 0).${(lib.lists.last color)};
convertColor = color: (lookupTable 1).${(lib.lists.head color)} + (lookupTable 0).${(lib.lists.last color)};
recombineColors = colors: lib.lists.foldr (a: b: (toString a) + "," + (toString b)) "end" colors;
scheme = {
@ -101,9 +96,7 @@ let
convertHex (lib.strings.stringToCharacters baseScheme.base0F)
);
};
in
{
in {
# temp
# crust -> surface1
# subtext0 -> surface2

View file

@ -3,14 +3,12 @@
inputs,
pkgs,
...
}:
let
}: let
# at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
in
{
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
in {
xdg.configFile."oxiced/theme.toml" = {
source = (pkgs.formats.toml {}).generate "oxiced" {
name = scheme.scheme;

View file

@ -4,23 +4,25 @@
pkgs,
lib,
...
}:
let
}: let
username = config.conf.username;
# at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
# active_colors=#ffc0caf5, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ffc0caf5, #ffc0caf5, #ffc0caf5, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ffc0caf5, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ffc0caf5, #ffc0caf5
# disabled_colors=#ff6d728d, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ff6d728d, #ff6d728d, #ff6d728d, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ff6d728d, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ff6d728d, #ff6d728d
# inactive_colors=#ff6d728d, #${scheme.base00}, #ff373949, #ff2b2c3b, #ff1a1b26, #ff2b2c3b, #ff6d728d, #ff6d728d, #ff6d728d, #ff1a1b26, #ff1a1b26, #19000000, #ff2b2c3b, #ff6d728d, #ff3584e4, #ff1b6acb, #ff1a1b26, #ff242530, #ff1a1b26, #ff6d728d, #ff6d728d
color = ''
[ColorScheme]
active_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04}
disabled_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04}
inactive_colors=#ff${scheme.base05}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base00}, #ff${scheme.base05}, #ff${scheme.base04}, #ff${scheme.base05}, #ff${scheme.base00}, #ff${scheme.base00}, #00${scheme.base01}, #ff${scheme.base02}, #ff${scheme.base04}, #ff${scheme.base08}, #ff${scheme.base04}, #ff${scheme.base01}, #ff${scheme.base00}, #ff${scheme.base01}, #ff${scheme.base05}, #ff${scheme.base04}
'';
qss = ''
QTabBar::tab:selected {
color: palette(highlight);
}
@ -28,33 +30,7 @@ let
border: none;
}
'';
## test
#cfg = config.stylix.targets.qt;
kvconfig = config.lib.stylix.colors {
template = ./kvconfig.mustache;
extension = ".kvconfig";
};
svg = config.lib.stylix.colors {
template = ./kvantum-svg.mustache;
extension = "svg";
};
kvantumPackage = pkgs.runCommandLocal "base16-kvantum" { } ''
directory="$out/share/Kvantum/Base16Kvantum"
mkdir --parents "$directory"
cat ${kvconfig} >>"$directory/Base16Kvantum.kvconfig"
cat ${svg} >>"$directory/Base16Kvantum.svg"
'';
xdg.configFile."Kvantum/kvantum.kvconfig".source =
(pkgs.formats.ini { }).generate "kvantum.kvconfig"
{
General.theme = "Base16Kvantum";
};
xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum";
in
{
in {
xdg.configFile."qt5ct/colors/tokyonight.conf" = {
text = "${color}";
};
@ -64,34 +40,18 @@ in
xdg.configFile."qt5ct/qss/tab.qss" = {
text = "${qss}";
};
stylix.targets.qt = {
enable = false;
};
qt = {
enable = true;
style.package = pkgs.libsForQt5.breeze-qt5;
style.name = lib.mkForce "breeze-dark";
};
# ## test
# xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
# General.theme = "Base16Kvantum";
# };
# xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum";
# xdg.configFile."qt5ct/qt5ct.conf".text = ''
# [Appearance]
# style=kvantum
# '';
# #icon_theme=${cfg.iconThemeName}
# xdg.configFile."qt6ct/qt6ct.conf".text = ''
# [Appearance]
# style=kvantum
# '';
# #icon_theme=${cfg.iconThemeName}
xdg.configFile."qt5ct/qt5ct.conf" = {
text = ''
[Appearance]
color_scheme_path=/home/${username}/.config/qt5ct/colors/tokyonight.conf
custom_palette=true
@ -128,6 +88,7 @@ in
};
xdg.configFile."qt6ct/qt6ct.conf" = {
text = ''
[Appearance]
color_scheme_path=/home/${username}/.config/qt6ct/colors/tokyonight.conf
custom_palette=true

View file

@ -4,9 +4,7 @@
modulesPath,
self,
...
}:
{
}: {
imports = ["${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"];
nixpkgs.hostPlatform = {
system = "x86_64-linux";

View file

@ -1,12 +1,11 @@
{
inputs,
lib,
pkgs,
self,
stable,
lib,
...
}:
{
}: {
/*
*
# build_systems
@ -35,8 +34,7 @@
# );
# in
build_systems =
{
build_systems = {
root,
additionalMods ? {
nixos = [];
@ -75,14 +73,11 @@
map
(name: {
name = name;
value =
let
value = let
mod = root + /hosts/${name}/configuration.nix;
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
additionalHomeConfig = root + /hosts/${name}/home.nix;
in
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
args = {
inherit
self
inputs
@ -90,15 +85,27 @@
additionalHomeConfig
root
;
pkgs = if overridePkgs then stable else pkgs;
alternativePkgs = if overridePkgs then pkgs else stable;
pkgs = lib.mkForce (
if overridePkgs
then stable
else pkgs
);
alternativePkgs =
if overridePkgs
then pkgs
else stable;
hostName = name;
homeMods = mods.home;
additionalHomeMods = additionalMods.home;
additionalInputs = additionalInputs;
};
in
inputs.nixpkgs.lib.nixosSystem {
modules =
[ mod ]
[
{_module.args = args;}
mod
]
++ mods.nixos
++ additionalMods.nixos
++ inputs.nixpkgs.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
@ -107,7 +114,10 @@
})
(
lib.lists.remove "" (
lib.attrsets.mapAttrsToList (name: fType: if fType == "directory" then name else "") (
lib.attrsets.mapAttrsToList (name: fType:
if fType == "directory"
then name
else "") (
builtins.readDir (root + /hosts)
)
)
@ -118,6 +128,8 @@
specialArgs = {
inherit self inputs pkgs;
};
modules = [ ../iso/configuration.nix ];
modules = [
../iso/configuration.nix
];
};
}

View file

@ -4,16 +4,12 @@
pkgs,
options,
...
}:
{
}: {
options.conf = {
system = lib.mkOption {
default = "x86_64-linux";
# no fisherprice unix support
type =
with lib.types;
(enum [
type = with lib.types; (enum [
"x86_64-linux"
"aarch64-linux"
"aarch64-linux-android"
@ -27,9 +23,7 @@
cpu = lib.mkOption {
# TODO: how to enable arm?
default = "amd";
type =
with lib.types;
(enum [
type = with lib.types; (enum [
"amd"
"intel"
]);
@ -175,7 +169,6 @@
Home state version
'';
};
};
config =

View file

@ -3,9 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods = {
acpid.enable = lib.mkOption {
default = false;

View file

@ -3,10 +3,8 @@
lib,
options,
pkgs,
inputs,
...
}:
{
}: {
options.mods = {
basePackages = {
enable = lib.mkOption {
@ -47,7 +45,8 @@
config = lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages =
if config.mods.basePackages.enable then
if config.mods.basePackages.enable
then
with pkgs;
[
adwaita-icon-theme
@ -70,19 +69,19 @@
libsForQt5.qtstyleplugin-kvantum
libadwaita
libxkbcommon
nixfmt-rfc-style
alejandra
openssl
seahorse
upower
xorg.xkbutils
]
++ config.mods.basePackages.additionalPackages
else
config.mods.basePackages.additionalPackages;
else config.mods.basePackages.additionalPackages;
gtk.iconCache.enable = false;
services =
if config.mods.basePackages.enable then
if config.mods.basePackages.enable
then
{
upower.enable = true;
dbus = {
@ -95,11 +94,11 @@
};
}
// config.mods.basePackages.specialServices
else
config.mods.basePackages.specialServices;
else config.mods.basePackages.specialServices;
programs =
if config.mods.basePackages.enable then
if config.mods.basePackages.enable
then
{
nix-ld = {
enable = true;
@ -121,8 +120,6 @@
gnupg.agent.enable = true;
}
// config.mods.basePackages.specialPrograms
else
config.mods.basePackages.specialPrograms;
else config.mods.basePackages.specialPrograms;
};
}

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods = {
bluetooth.enable = lib.mkOption {
default = false;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.browser.brave = {
enable = lib.mkOption {
default = false;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.browser.chromium = {
enable = lib.mkOption {
default = false;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.browser.firefox = {
enable = lib.mkOption {
default = false;

View file

@ -5,8 +5,7 @@
system,
inputs,
...
}:
{
}: {
options.mods.browser.zen = {
enable = lib.mkOption {
default = false;

View file

@ -4,8 +4,7 @@
pkgs,
options,
...
}:
{
}: {
options.mods = {
coding = {
enable = lib.mkOption {
@ -415,8 +414,7 @@
};
};
config =
let
config = let
basePackages = with pkgs; [
gitui
meson
@ -466,8 +464,7 @@
};
};
};
home.packages =
with pkgs;
home.packages = with pkgs;
[
(lib.mkIf config.mods.coding.dashvim neovide)
(lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox)

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.containers = {
variant = lib.mkOption {
default = "";
@ -48,16 +47,19 @@
environment.systemPackages =
(lib.lists.optionals (
config.mods.containers.variant == "podman"
) config.mods.containers.podmanPackages)
)
config.mods.containers.podmanPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "docker"
) config.mods.containers.dockerPackages)
)
config.mods.containers.dockerPackages)
++ (lib.lists.optionals (
config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker"
) config.mods.containers.combinedPackages);
)
config.mods.containers.combinedPackages);
virtualisation =
if (config.mods.containers.variant == "podman") then
{
if (config.mods.containers.variant == "podman")
then {
containers.enable = true;
podman = {
enable = true;
@ -65,15 +67,14 @@
defaultNetwork.settings.dns_enabled = true;
};
}
else if (config.mods.containers.variant == "docker") then
{
else if (config.mods.containers.variant == "docker")
then {
containers.enable = true;
docker = {
enable = true;
};
}
else
{ };
else {};
}
);
}

View file

@ -3,9 +3,7 @@
config,
options,
...
}:
let
}: let
driveModule = lib.types.submodule {
options = {
name = lib.mkOption {
@ -33,8 +31,7 @@ let
};
};
};
in
{
in {
options.mods = {
drives = {
useSwap = {
@ -59,7 +56,6 @@ in
};
extraDrives = lib.mkOption {
default = [
];
example = [
{
@ -90,12 +86,15 @@ in
fileSystems =
builtins.listToAttrs (
map (
{ name, drive }:
{
name,
drive,
}: {
name = "/" + name;
value = drive;
}
) config.mods.drives.extraDrives
)
config.mods.drives.extraDrives
)
// (lib.optionalAttrs config.mods.drives.defaultDrives.enable) {
"/" = {

View file

@ -5,12 +5,10 @@
config,
options,
...
}:
let
}: let
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
in
{
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
in {
options.mods.fish = {
enable = lib.mkOption {
default = true;
@ -36,7 +34,8 @@ in
programs.fish = {
enable = true;
shellInit =
if config.mods.fish.useDefaultConfig then
if config.mods.fish.useDefaultConfig
then
''
if status is-interactive
# Commands to run in interactive sessions can go here
@ -182,8 +181,7 @@ in
direnv hook fish | source
''
+ config.mods.fish.additionalConfig
else
config.mods.fish.additionalConfig;
else config.mods.fish.additionalConfig;
};
}
);

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.flatpak = {
enable = lib.mkOption {
default = true;
@ -32,11 +31,13 @@
services.flatpak.uninstallUnmanaged = true;
}
// lib.optionalAttrs (options ? services.flatpak.packages) {
services.flatpak.packages = [
services.flatpak.packages =
[
# fallback if necessary, but generally avoided as nix is superior :)
# default flatseal installation since flatpak permissions are totally not a broken idea
"com.github.tchx84.Flatseal"
] ++ config.mods.flatpak.additional_packages;
]
++ config.mods.flatpak.additional_packages;
}
);
}

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.gaming = {
enable = lib.mkOption {
default = false;

View file

@ -3,8 +3,7 @@
options,
config,
...
}:
{
}: {
options.mods.gdm = {
enable = lib.mkOption {
default = false;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.git = {
username = lib.mkOption {
default = "DashieTM";
@ -38,24 +37,21 @@
default = ''
Host github.com
${
if (config ? sops.secrets && config.sops.secrets ? hub.path) then
"IdentityFile ${config.sops.secrets.hub.path}"
else
""
if (config ? sops.secrets && config.sops.secrets ? hub.path)
then "IdentityFile ${config.sops.secrets.hub.path}"
else ""
}
Host gitlab.com
${
if (config ? sops.secrets && config.sops.secrets ? lab.path) then
"IdentityFile ${config.sops.secrets.lab.path}"
else
""
if (config ? sops.secrets && config.sops.secrets ? lab.path)
then "IdentityFile ${config.sops.secrets.lab.path}"
else ""
}
Host dashie.org
${
if (config ? sops.secrets && config.sops.secrets ? dashie.path) then
"IdentityFile ${config.sops.secrets.dashie.path}"
else
""
if (config ? sops.secrets && config.sops.secrets ? dashie.path)
then "IdentityFile ${config.sops.secrets.dashie.path}"
else ""
}
'';
example = "";

View file

@ -4,8 +4,7 @@
config,
pkgs,
...
}:
{
}: {
options.mods.gnome = {
enable = lib.mkOption {
default = false;
@ -33,8 +32,7 @@
};
};
config =
let
config = let
defaultExtensions = with pkgs.gnomeExtensions; [
blur-my-shell
dash-to-dock

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods = {
gnomeServices.enable = lib.mkOption {
default = true;
@ -66,8 +65,7 @@
};
};
home = {
packages =
let
packages = let
packages = with pkgs; [
gcr
nautilus

View file

@ -4,9 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods = {
gpu = {
nvidia.enable = lib.mkOption {
@ -63,13 +61,13 @@
};
hardware = {
graphics =
let
graphics = let
amdPackages = [
(lib.mkIf (config.mods.gpu.intelgpu && lib.mkIf config.mods.gpu.vapi.enable) pkgs.vpl-gpu-rt)
(lib.mkIf (
config.mods.gpu.intelgpu && lib.mkIf config.mods.gpu.vapi.enable
) pkgs.intel-media-driver)
)
pkgs.intel-media-driver)
(lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl)
(lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau)
(lib.mkIf (config.mods.gpu.intelgpu || config.mods.gpu.amdgpu) pkgs.mesa.drivers)
@ -78,8 +76,7 @@
pkgs.rocmPackages.clr.icd
pkgs.rocm-opencl-runtime
];
in
{
in {
enable = true;
enable32Bit = lib.mkDefault true;
extraPackages =

View file

@ -5,8 +5,7 @@
pkgs,
options,
...
}:
{
}: {
options.mods = {
greetd = {
enable = lib.mkOption {
@ -70,8 +69,7 @@
};
};
config =
let
config = let
username = config.conf.username;
session = {
command = "${

View file

@ -5,8 +5,7 @@
pkgs,
inputs,
...
}:
{
}: {
options.mods.homePackages = {
useDefaultPackages = lib.mkOption {
default = true;
@ -72,19 +71,20 @@
browser = lib.mkOption {
default = inputs.zen-browser.packages.${pkgs.system}.default;
example = "firefox";
type =
with lib.types;
type = with lib.types;
nullOr (
either (enum [
"firefox"
]) package
])
package
);
description = "The browser (the enum variants have preconfigured modules)";
};
};
config = lib.optionalAttrs (options ? home.packages) {
home.packages =
if config.mods.homePackages.useDefaultPackages then
if config.mods.homePackages.useDefaultPackages
then
with pkgs;
[
(lib.mkIf config.mods.homePackages.ncspot ncspot)
@ -95,7 +95,8 @@
(lib.mkIf (
# NOTE: This should be package, but nix doesn't have that....
builtins.isAttrs config.mods.homePackages.browser && !isNull config.mods.homePackages.browser
) config.mods.homePackages.browser)
)
config.mods.homePackages.browser)
adw-gtk3
bat
brightnessctl
@ -128,8 +129,7 @@
zoxide
]
++ config.mods.homePackages.additionalPackages
else
config.mods.homePackages.additionalPackages;
else config.mods.homePackages.additionalPackages;
xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml {}).generate "direnv" {
global = {
@ -139,21 +139,19 @@
programs =
config.mods.homePackages.specialPrograms
// (
if config.mods.homePackages.browser == "firefox" then
{
if config.mods.homePackages.browser == "firefox"
then {
firefox = {
enable = true;
policies = config.mods.browser.firefox.configuration;
profiles = builtins.listToAttrs config.mods.browser.firefox.profiles;
};
}
else
{ }
else {}
);
services =
if config.mods.homePackages.useDefaultPackages then
config.mods.homePackages.specialServices
else
config.mods.homePackages.specialServices;
if config.mods.homePackages.useDefaultPackages
then config.mods.homePackages.specialServices
else config.mods.homePackages.specialServices;
};
}

View file

@ -5,8 +5,7 @@
options,
inputs,
...
}:
{
}: {
options.mods = {
hyprland = {
anyrun = {
@ -63,7 +62,8 @@
programs.anyrun = {
enable = true;
config =
if config.mods.hyprland.anyrun.useDefaultConfig then
if config.mods.hyprland.anyrun.useDefaultConfig
then
{
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
@ -84,11 +84,11 @@
closeOnClick = true;
}
// config.mods.hyprland.anyrun.customConfig
else
config.mods.hyprland.anyrun.customConfig;
else config.mods.hyprland.anyrun.customConfig;
extraCss =
if config.mods.hyprland.anyrun.useDefaultCss then
if config.mods.hyprland.anyrun.useDefaultCss
then
''
#window {
border-radius: 10px;
@ -138,8 +138,7 @@
}
''
+ config.mods.hyprland.anyrun.customCss
else
config.mods.hyprland.anyrun.customCss;
else config.mods.hyprland.anyrun.customCss;
};
}
);

View file

@ -5,19 +5,14 @@
pkgs,
inputs,
...
}:
let
}: let
browserName =
if (builtins.isString config.mods.homePackages.browser) then
config.mods.homePackages.browser
else if
config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then
config.mods.homePackages.browser.meta.mainProgram
else
config.mods.homePackages.browser.pname;
in
{
if (builtins.isString config.mods.homePackages.browser)
then config.mods.homePackages.browser
else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname;
in {
options.mods = {
hyprland = {
enable = lib.mkOption {
@ -129,7 +124,8 @@ in
wayland.windowManager.hyprland = {
enable = true;
settings =
if config.mods.hyprland.useDefaultConfig then
if config.mods.hyprland.useDefaultConfig
then
{
"$mod" = "SUPER";
@ -366,7 +362,8 @@ in
"immediate,class:^(.*)(needforspeedheat.exe)$"
];
exec-once = [
exec-once =
[
# environment
"systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all"
@ -378,22 +375,26 @@ in
"${browserName}"
"oxipaste_daemon"
"oxinoti"
] ++ config.mods.hyprland.extraAutostart;
]
++ config.mods.hyprland.extraAutostart;
plugin = {
plugin =
{
hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable {
bind = [
"SUPER, W, overview:toggle, toggle"
];
};
} // config.mods.hyprland.pluginConfig;
}
// config.mods.hyprland.pluginConfig;
}
// config.mods.hyprland.customConfig
else
lib.mkForce config.mods.hyprland.customConfig;
plugins = [
else lib.mkForce config.mods.hyprland.customConfig;
plugins =
[
(lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace)
] ++ config.mods.hyprland.plugins;
]
++ config.mods.hyprland.plugins;
};
}
);

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods = {
hyprland.hyprlock = {
enable = lib.mkOption {

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods = {
hyprland.hyprpaper = {
enable = lib.mkOption {

View file

@ -3,11 +3,9 @@
config,
options,
...
}:
let
}: let
username = config.conf.username;
in
{
in {
options.mods = {
hyprland.ironbar = {
enable = lib.mkOption {
@ -61,7 +59,8 @@ in
programs.ironbar = {
enable = true;
style =
if config.mods.hyprland.ironbar.useDefaultCss then
if config.mods.hyprland.ironbar.useDefaultCss
then
''
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
@ -197,16 +196,18 @@ in
}
''
+ config.mods.hyprland.ironbar.customCss
else
config.mods.hyprland.ironbar.customCss;
else config.mods.hyprland.ironbar.customCss;
features = [
#"another_feature"
];
config = {
monitors."${config.conf.defaultMonitor}" =
if config.mods.hyprland.ironbar.useDefaultConfig then
if config.mods.hyprland.ironbar.useDefaultConfig
then
{
end = config.conf.ironbar.modules ++ [
end =
config.conf.ironbar.modules
++ [
{
type = "sys_info";
format = [" {memory_percent}"];
@ -238,13 +239,13 @@ in
type = "button";
class = "audio-button";
label = "";
on_click = (lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth");
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = (lib.mkIf config.mods.scripts.audioControl "!audioControl internal");
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal";
}
];
class = "audio-button-box";
@ -317,8 +318,7 @@ in
];
}
// config.mods.hyprland.ironbar.customConfig
else
config.mods.hyprland.ironbar.customConfig;
else config.mods.hyprland.ironbar.customConfig;
};
};
}

View file

@ -3,8 +3,7 @@
options,
config,
...
}:
{
}: {
options.mods.kde = {
enable = lib.mkOption {
default = false;
@ -20,5 +19,4 @@
services.desktopManager.plasma6.enable = true;
}
);
}

View file

@ -4,9 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods = {
kdeConnect.enable = lib.mkOption {
default = false;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.keepassxc = {
enable = lib.mkOption {
default = true;

View file

@ -5,10 +5,9 @@
pkgs,
inputs,
...
}:
let
}: let
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
hexTable = {
"0" = "1";
"1" = "0";
@ -34,8 +33,7 @@ let
(lib.lists.take 5 (lib.strings.stringToCharacters scheme.base00))
++ [hexTable."${(lib.lists.last (lib.strings.stringToCharacters scheme.base00))}"]
);
in
{
in {
options.mods.kitty = {
enable = lib.mkOption {
default = true;
@ -60,7 +58,8 @@ in
};
programs.kitty = {
enable = true;
settings = {
settings =
{
enable_audio_bell = "no";
window_alert_on_bell = "no";
cursor_blink_interval = "0";
@ -132,7 +131,8 @@ in
# color15 = "#" + scheme.base07;
shell = lib.mkIf config.mods.fish.enable "fish";
} // config.mods.kitty.additionalConfig;
}
// config.mods.kitty.additionalConfig;
};
}
);

View file

@ -4,8 +4,7 @@
config,
pkgs,
...
}:
{
}: {
options.mods.media = {
useBasePackages = lib.mkOption {
default = true;
@ -40,7 +39,8 @@
};
config = lib.optionalAttrs (options ? home.packages) {
home.packages =
if config.mods.media.useBasePackages then
if config.mods.media.useBasePackages
then
with pkgs;
[
# base audio
@ -70,21 +70,19 @@
yt-dlp
]
++ config.mods.media.additionalPackages
else
config.mods.media.additionalPackages;
else config.mods.media.additionalPackages;
programs =
if config.mods.media.useBasePackages then
if config.mods.media.useBasePackages
then
{
obs-studio.enable = true;
obs-studio.plugins = with pkgs; [obs-studio-plugins.obs-vaapi];
}
// config.mods.media.specialPrograms
else
config.mods.media.specialPrograms;
else config.mods.media.specialPrograms;
services =
if config.mods.media.useBasePackages then
config.mods.media.specialServices
else
config.mods.media.specialServices;
if config.mods.media.useBasePackages
then config.mods.media.specialServices
else config.mods.media.specialServices;
};
}

View file

@ -5,19 +5,14 @@
lib,
options,
...
}:
let
}: let
browserName =
if (builtins.isString config.mods.homePackages.browser) then
config.mods.homePackages.browser
else if
config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then
config.mods.homePackages.browser.meta.mainProgram
else
config.mods.homePackages.browser.pname;
in
{
if (builtins.isString config.mods.homePackages.browser)
then config.mods.homePackages.browser
else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname;
in {
options.mods.mime = {
enable = lib.mkOption {
default = true;
@ -109,15 +104,14 @@ in
# TODO additional config
};
config = lib.optionalAttrs (options ? home) {
xdg =
let
xdgAssociations =
type: program: list:
xdg = let
xdgAssociations = type: program: list:
builtins.listToAttrs (
map (e: {
name = "${type}/${e}";
value = program;
}) list
})
list
);
imageAc = xdgAssociations "image" config.mods.mime.imageApplications config.mods.mime.imageTypes;
@ -125,7 +119,8 @@ in
audioAc = xdgAssociations "audio" config.mods.mime.audioApplications config.mods.mime.audioTypes;
browserAc =
(xdgAssociations "application" config.mods.mime.browserApplications config.mods.mime.browserTypes)
// (xdgAssociations "x-scheme-handler" config.mods.mime.browserApplications
// (
xdgAssociations "x-scheme-handler" config.mods.mime.browserApplications
config.mods.mime.browserXTypes
);
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) (

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.ncspot = {
enable = lib.mkOption {
default = false;

View file

@ -1,5 +1,4 @@
{ lib, ... }:
{
{lib, ...}: {
options.mods = {
nextcloud = {
enable = lib.mkOption {
@ -36,5 +35,4 @@
};
};
};
}

View file

@ -4,8 +4,7 @@
options,
inputs,
...
}:
{
}: {
imports = [
./oxidash.nix
./oxinoti.nix

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.oxi.oxidash = {
enable = lib.mkOption {
default = true;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.oxi.oxinoti = {
enable = lib.mkOption {
default = true;
@ -17,7 +16,8 @@
lib.optionalAttrs (options ? xdg.configFile) {
programs.oxinoti.enable = true;
xdg.configFile."oxinoti/style.css" = {
text = # css
text =
# css
''
@import url("/home/${config.conf.username}/.config/gtk-3.0/gtk.css");

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.oxi.oxipaste = {
enable = lib.mkOption {
default = true;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.oxi.oxishut = {
enable = lib.mkOption {
default = true;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.piper = {
enable = lib.mkOption {
default = false;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.plymouth = {
enable = lib.mkOption {
default = true;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.printing = {
enable = lib.mkOption {
default = true;

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.scripts = {
changeBrightness = lib.mkOption {
default = true;
@ -27,7 +26,8 @@
};
config = (
lib.optionalAttrs (options ? home.packages) {
home.packages = [
home.packages =
[
(lib.mkIf config.mods.scripts.changeBrightness (
pkgs.writeShellScriptBin "changeBrightness" ''
set_brightness() {
@ -124,7 +124,8 @@
fi
''
))
] ++ config.mods.scripts.scripts;
]
++ config.mods.scripts.scripts;
}
);
}

View file

@ -3,8 +3,7 @@
options,
config,
...
}:
{
}: {
options.mods.sddm = {
enable = lib.mkOption {
default = false;

View file

@ -5,8 +5,7 @@
options,
root,
...
}:
{
}: {
options.mods.sops = {
enable = lib.mkOption {
default = true;
@ -29,8 +28,7 @@
sopsPath = lib.mkOption {
default = root + /secrets/secrets.yaml;
example = "/your/path";
type =
with lib.types;
type = with lib.types;
oneOf [
str
path

View file

@ -5,8 +5,7 @@
pkgs,
inputs,
...
}:
{
}: {
options.mods = {
starship = {
enable = lib.mkOption {
@ -40,13 +39,11 @@
# environment.systemPackages needed in order to configure systemwide
config = lib.mkIf config.mods.starship.enable (
lib.optionalAttrs (options ? environment.systemPackages) {
programs.starship =
let
programs.starship = let
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in
{
in {
enable = true;
interactiveOnly = true;
presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"];

View file

@ -4,8 +4,7 @@
options,
pkgs,
...
}:
{
}: {
options.mods.stylix = {
colorscheme = lib.mkOption {
default = "catppuccin-mocha";
@ -34,8 +33,7 @@
base0E = "BB9AF7";
base0F = "F7768E";
};
type =
with lib.types;
type = with lib.types;
oneOf [
str
attrs
@ -101,10 +99,9 @@
fonts = config.mods.stylix.fonts;
cursor = config.mods.stylix.cursor;
base16Scheme = (
if builtins.isAttrs config.mods.stylix.colorscheme then
config.mods.stylix.colorscheme
else
"${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml"
if builtins.isAttrs config.mods.stylix.colorscheme
then config.mods.stylix.colorscheme
else "${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml"
);
};
})

View file

@ -5,12 +5,10 @@
pkgs,
inputs,
...
}:
let
}: let
base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
in
{
in {
options.mods.supersonic = {
enable = lib.mkOption {
default = false;
@ -31,7 +29,11 @@ in
config = lib.mkIf config.mods.supersonic.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [
(if config.mods.supersonic.variant == "wayland" then supersonic-wayland else supersonic)
(
if config.mods.supersonic.variant == "wayland"
then supersonic-wayland
else supersonic
)
];
xdg.configFile."supersonic/themes/custom.toml".source =
(pkgs.formats.toml {}).generate "customTheme"
@ -67,6 +69,5 @@ in
};
};
}
);
}

View file

@ -3,12 +3,11 @@
config,
options,
pkgs,
stable,
...
}:
let
}: let
callPackage = lib.callPackageWith pkgs;
in
{
in {
options.mods.teams = {
enable = lib.mkOption {
default = false;
@ -25,7 +24,7 @@ in
};
config = lib.mkIf config.mods.teams.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = [ (callPackage ../../override/teams.nix { }) ];
home.packages = [(callPackage ../../override/teams.nix {pkgs = stable;})];
}
// (lib.optionalAttrs (options ? boot.kernelModules) {
boot = {

View file

@ -4,18 +4,14 @@
options,
pkgs,
...
}:
let
}: let
module =
if config.conf.cpu == "intel" then
"kvm-intel"
else if config.conf.cpu == "amd" then
"kvm-amd"
else
"";
in
{
if config.conf.cpu == "intel"
then "kvm-intel"
else if config.conf.cpu == "amd"
then "kvm-amd"
else "";
in {
options.mods = {
virtmanager.enable = lib.mkOption {
default = false;
@ -60,7 +56,6 @@ in
"kvm"
"qemu-libvirtd"
];
}
// lib.optionalAttrs (options ? dconf.settings) {
dconf.settings = {

View file

@ -3,8 +3,7 @@
options,
config,
...
}:
{
}: {
options.mods.xkb = {
layout = lib.mkOption {
default = "dashie";

View file

@ -3,9 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods = {
xone.enable = lib.mkOption {
default = false;

View file

@ -3,8 +3,7 @@
config,
options,
...
}:
{
}: {
options.mods.yazi = {
enable = lib.mkOption {
default = true;
@ -37,8 +36,7 @@
description = "Additional keymap for yazi";
};
};
config =
let
config = let
conf = import ./yazi.nix;
in
lib.optionalAttrs (options ? home.packages) (