refactor(repo): reformat to nixfmt; relicense to 0BSD

This commit is contained in:
Artur Manuel 2025-03-06 20:45:49 +00:00
commit db2564d828
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
39 changed files with 451 additions and 318 deletions

21
LICENSE
View file

@ -1,13 +1,12 @@
Copyright 2025 Artur Manuel <balkenix@outlook.com> Copyright (c) 2025 Artur Manuel <amad@atl.tools>
Licensed under the Apache License, Version 2.0 (the "License"); Permission to use, copy, modify, and/or distribute this software for any
you may not use this file except in compliance with the License. purpose with or without fee is hereby granted.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
Unless required by applicable law or agreed to in writing, software MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
distributed under the License is distributed on an "AS IS" BASIS, ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
See the License for the specific language governing permissions and ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
limitations under the License. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -72,11 +72,14 @@
ref = "gimp-meson"; ref = "gimp-meson";
}; };
}; };
outputs = inputs @ {flake-parts, ...}: outputs =
flake-parts.lib.mkFlake { inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake
{
inherit inputs; inherit inputs;
} { }
systems = ["x86_64-linux"]; {
systems = [ "x86_64-linux" ];
imports = [ imports = [
./hosts ./hosts
./shells ./shells

View file

@ -2,9 +2,11 @@
inputs, inputs,
self, self,
... ...
}: let }:
let
inherit (self.lib) mkHosts; inherit (self.lib) mkHosts;
in { in
{
flake = { flake = {
nixosConfigurations = mkHosts { nixosConfigurations = mkHosts {
solterra = { solterra = {

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
boot.kernel.sysctl = { boot.kernel.sysctl = {
"dev.tty.ldisc_autoload" = "0"; "dev.tty.ldisc_autoload" = "0";
"fs.protected_fifos" = "2"; "fs.protected_fifos" = "2";

View file

@ -1,12 +1,11 @@
{...}: { { ... }:
{
boot.kernel.sysctl = { boot.kernel.sysctl = {
"vm.dirty_ratio" = 20; "vm.dirty_ratio" = 20;
"vm.dirty_background_ratio" = 10; "vm.dirty_background_ratio" = 10;
"vm.vfs_cache_pressure" = 25; "vm.vfs_cache_pressure" = 25;
"net.core.default_qdisc" = '' "net.core.default_qdisc" = ''cake'';
cake''; "net.ipv4.tcp_congestion_control" = ''bbr'';
"net.ipv4.tcp_congestion_control" = ''
bbr'';
"vm.page-cluster" = 1; "vm.page-cluster" = 1;
"kernel.nmi_watchdog" = 0; "kernel.nmi_watchdog" = 0;
"vm.swappiness" = 200; "vm.swappiness" = 200;
@ -22,10 +21,8 @@
"net.core.wmem_default" = 1048576; "net.core.wmem_default" = 1048576;
"net.core.wmem_max" = 16777216; "net.core.wmem_max" = 16777216;
"net.core.optmem_max" = 65536; "net.core.optmem_max" = 65536;
"net.ipv4.tcp_rmem" = '' "net.ipv4.tcp_rmem" = ''4096 1048576 2097152'';
4096 1048576 2097152''; "net.ipv4.tcp_wmem" = ''4096 65536 16777216'';
"net.ipv4.tcp_wmem" = ''
4096 65536 16777216'';
"net.ipv4.udp_rmem_min" = 16384; "net.ipv4.udp_rmem_min" = 16384;
"net.ipv4.udp_wmem_min" = 16384; "net.ipv4.udp_wmem_min" = 16384;
"net.ipv4.tcp_fastopen" = 3; "net.ipv4.tcp_fastopen" = 3;
@ -37,7 +34,6 @@
"net.ipv4.tcp_keepalive_intvl" = 10; "net.ipv4.tcp_keepalive_intvl" = 10;
"net.ipv4.tcp_keepalive_probes" = 6; "net.ipv4.tcp_keepalive_probes" = 6;
"net.ipv4.tcp_mtu_probing" = 1; "net.ipv4.tcp_mtu_probing" = 1;
"net.ipv4.ip_local_port_range" = '' "net.ipv4.ip_local_port_range" = ''30000 65535'';
30000 65535'';
}; };
} }

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
imports = [ imports = [
./hardware.nix ./hardware.nix
./system.nix ./system.nix

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
services.tlp = { services.tlp = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,17 +1,35 @@
{pkgs, ...}: { { pkgs, ... }:
{
alqueva.system.fonts = { alqueva.system.fonts = {
enable = true; enable = true;
names = { names = {
sansSerif = ["Liberation Sans"]; sansSerif = [ "Liberation Sans" ];
monospace = ["JetBrainsMono Nerd Font"]; monospace = [ "JetBrainsMono Nerd Font" ];
serif = ["Liberation Serif"]; serif = [ "Liberation Serif" ];
emoji = ["OpenMoji Color"]; emoji = [ "OpenMoji Color" ];
}; };
packages = { packages = {
sansSerif = [pkgs.liberation_ttf pkgs.noto-fonts pkgs.noto-fonts-cjk-sans pkgs.noto-fonts-cjk-serif]; sansSerif = [
monospace = [pkgs.nerd-fonts.jetbrains-mono pkgs.noto-fonts]; pkgs.liberation_ttf
serif = [pkgs.liberation_ttf pkgs.noto-fonts pkgs.noto-fonts pkgs.noto-fonts-cjk-sans pkgs.noto-fonts-cjk-serif]; pkgs.noto-fonts
emoji = [pkgs.openmoji-color pkgs.noto-fonts]; pkgs.noto-fonts-cjk-sans
pkgs.noto-fonts-cjk-serif
];
monospace = [
pkgs.nerd-fonts.jetbrains-mono
pkgs.noto-fonts
];
serif = [
pkgs.liberation_ttf
pkgs.noto-fonts
pkgs.noto-fonts
pkgs.noto-fonts-cjk-sans
pkgs.noto-fonts-cjk-serif
];
emoji = [
pkgs.openmoji-color
pkgs.noto-fonts
];
}; };
}; };
} }

View file

@ -6,32 +6,40 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = []; "nvme"
boot.kernelModules = ["kvm-amd"]; "xhci_pci"
boot.extraModulePackages = []; ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/41853b7d-f098-4ae6-ae9c-1b97b1074bde"; device = "/dev/disk/by-uuid/41853b7d-f098-4ae6-ae9c-1b97b1074bde";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@"]; options = [ "subvol=@" ];
}; };
boot.initrd.luks.devices."luks-fc6b34e2-c93a-4d14-8194-1c30b63f8fb5".device = "/dev/disk/by-uuid/fc6b34e2-c93a-4d14-8194-1c30b63f8fb5"; boot.initrd.luks.devices."luks-fc6b34e2-c93a-4d14-8194-1c30b63f8fb5".device =
"/dev/disk/by-uuid/fc6b34e2-c93a-4d14-8194-1c30b63f8fb5";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/47C4-D06C"; device = "/dev/disk/by-uuid/47C4-D06C";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0077" "dmask=0077"]; options = [
"fmask=0077"
"dmask=0077"
];
}; };
swapDevices = [ swapDevices = [
{device = "/dev/disk/by-uuid/5743e1ce-4f91-4ab9-9b5d-b46eeda3fb1e";} { device = "/dev/disk/by-uuid/5743e1ce-4f91-4ab9-9b5d-b46eeda3fb1e"; }
]; ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
networking = { networking = {
networkmanager = { networkmanager = {
enable = true; enable = true;
@ -29,7 +30,7 @@
services.resolved = { services.resolved = {
enable = true; enable = true;
dnssec = "true"; dnssec = "true";
domains = ["~."]; domains = [ "~." ];
fallbackDns = [ fallbackDns = [
"1.1.1.1#cloudflare-dns.com" "1.1.1.1#cloudflare-dns.com"
"1.0.0.1#cloudflare-dns.com" "1.0.0.1#cloudflare-dns.com"

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
services.pipewire = { services.pipewire = {
enable = true; enable = true;
wireplumber = { wireplumber = {
@ -26,12 +27,12 @@
"support.*" = "support/libspa-support"; "support.*" = "support/libspa-support";
}; };
"modules" = [ "modules" = [
{"name" = "libpipewire-module-protocol-native";} { "name" = "libpipewire-module-protocol-native"; }
{"name" = "libpipewire-module-client-node";} { "name" = "libpipewire-module-client-node"; }
{"name" = "libpipewire-module-client-device";} { "name" = "libpipewire-module-client-device"; }
{"name" = "libpipewire-module-adapter";} { "name" = "libpipewire-module-adapter"; }
{"name" = "libpipewire-module-metadata";} { "name" = "libpipewire-module-metadata"; }
{"name" = "libpipewire-module-session-manager";} { "name" = "libpipewire-module-session-manager"; }
]; ];
}; };
"filter" = { "filter" = {
@ -67,14 +68,17 @@
"rt.time.soft" = -1; "rt.time.soft" = -1;
"rt.time.hard" = -1; "rt.time.hard" = -1;
}; };
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
} }
{"name" = "libpipewire-module-protocol-native";} { "name" = "libpipewire-module-protocol-native"; }
{"name" = "libpipewire-module-client-node";} { "name" = "libpipewire-module-client-node"; }
{"name" = "libpipewire-module-client-device";} { "name" = "libpipewire-module-client-device"; }
{"name" = "libpipewire-module-adapter";} { "name" = "libpipewire-module-adapter"; }
{"name" = "libpipewire-module-metadata";} { "name" = "libpipewire-module-metadata"; }
{"name" = "libpipewire-module-session-manager";} { "name" = "libpipewire-module-session-manager"; }
]; ];
}; };
"filter" = { "filter" = {
@ -147,7 +151,10 @@
"uclamp.min" = 0; "uclamp.min" = 0;
"uclamp.max" = 2048; "uclamp.max" = 2048;
}; };
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
} }
{ {
"name" = "libpipewire-module-protocol-native"; "name" = "libpipewire-module-protocol-native";
@ -163,7 +170,7 @@
} }
{ {
"name" = "libpipewire-module-protocol-pulse"; "name" = "libpipewire-module-protocol-pulse";
"args" = {}; "args" = { };
} }
]; ];
"exec" = [ "exec" = [
@ -177,22 +184,22 @@
{ {
"cmd" = "load-module"; "cmd" = "load-module";
"args" = "module-always-sink"; "args" = "module-always-sink";
"flags" = []; "flags" = [ ];
} }
{ {
"cmd" = "load-module"; "cmd" = "load-module";
"args" = "module-device-manager"; "args" = "module-device-manager";
"flags" = []; "flags" = [ ];
} }
{ {
"cmd" = "load-module"; "cmd" = "load-module";
"args" = "module-device-restore"; "args" = "module-device-restore";
"flags" = []; "flags" = [ ];
} }
{ {
"cmd" = "load-module"; "cmd" = "load-module";
"args" = "module-stream-restore"; "args" = "module-stream-restore";
"flags" = []; "flags" = [ ];
} }
{ {
"cmd" = "load-module"; "cmd" = "load-module";
@ -201,7 +208,7 @@
{ {
"cmd" = "load-module"; "cmd" = "load-module";
"args" = "module-gsettings"; "args" = "module-gsettings";
"flags" = ["nofail"]; "flags" = [ "nofail" ];
} }
]; ];
"properties" = { "properties" = {
@ -237,7 +244,10 @@
"context.data-loops" = [ "context.data-loops" = [
{ {
"loop.rt-prio" = -1; "loop.rt-prio" = -1;
"loop.class" = ["data.rt" "audio.rt"]; "loop.class" = [
"data.rt"
"audio.rt"
];
"library.name.system" = "support/libspa-support"; "library.name.system" = "support/libspa-support";
"thread.name" = "data-loop.0"; "thread.name" = "data-loop.0";
} }
@ -245,7 +255,7 @@
"core.daemon" = true; "core.daemon" = true;
"core.name" = "pipewire-0"; "core.name" = "pipewire-0";
"default.clock.rate" = 192000; "default.clock.rate" = 192000;
"default.clock.allowed-rates" = [192000]; "default.clock.allowed-rates" = [ 192000 ];
"module.x11.bell" = true; "module.x11.bell" = true;
"module.access" = true; "module.access" = true;
"module.jackdbus-detect" = true; "module.jackdbus-detect" = true;
@ -287,7 +297,10 @@
"uclamp.min" = 0; "uclamp.min" = 0;
"uclamp.max" = 2048; "uclamp.max" = 2048;
}; };
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
} }
{ {
"name" = "libpipewire-module-protocol-native"; "name" = "libpipewire-module-protocol-native";
@ -304,7 +317,10 @@
} }
{ {
"name" = "libpipewire-module-portal"; "name" = "libpipewire-module-portal";
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
} }
{ {
"name" = "libpipewire-module-access"; "name" = "libpipewire-module-access";
@ -328,7 +344,10 @@
"x11.display" = null; "x11.display" = null;
"x11.xauthority" = null; "x11.xauthority" = null;
}; };
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
"condition" = [ "condition" = [
{ {
"module.x11.bell" = true; "module.x11.bell" = true;
@ -338,10 +357,13 @@
{ {
"name" = "libpipewire-module-jackdbus-detect"; "name" = "libpipewire-module-jackdbus-detect";
"args" = { "args" = {
"source.props" = {}; "source.props" = { };
"sink.props" = {}; "sink.props" = { };
}; };
"flags" = ["ifexists" "nofail"]; "flags" = [
"ifexists"
"nofail"
];
"condition" = [ "condition" = [
{ {
"module.jackdbus-detect" = true; "module.jackdbus-detect" = true;

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
programs.ssh = { programs.ssh = {
startAgent = true; startAgent = true;
enableAskPassword = true; enableAskPassword = true;

View file

@ -1,7 +1,8 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{pkgs, ...}: { { pkgs, ... }:
{
imports = [ imports = [
./config/sysctl.d/performance.nix ./config/sysctl.d/performance.nix
./config/sysctl.d/hardening.nix ./config/sysctl.d/hardening.nix
@ -57,7 +58,7 @@
enable = true; enable = true;
package = pkgs.scx_git.rustscheds; package = pkgs.scx_git.rustscheds;
scheduler = "scx_lavd"; scheduler = "scx_lavd";
extraArgs = ["--performance"]; extraArgs = [ "--performance" ];
}; };
boot.runSize = "100%"; boot.runSize = "100%";
@ -69,11 +70,16 @@
fileSystems."/" = { fileSystems."/" = {
fsType = "btrfs"; fsType = "btrfs";
options = ["compress=zstd:6" "discard" "flushoncommit" "subvol=@"]; options = [
"compress=zstd:6"
"discard"
"flushoncommit"
"subvol=@"
];
}; };
services.btrfs.autoScrub = { services.btrfs.autoScrub = {
fileSystems = ["/"]; # Assuming root is formatted with Btrfs. fileSystems = [ "/" ]; # Assuming root is formatted with Btrfs.
interval = "daily"; interval = "daily";
enable = true; enable = true;
}; };
@ -101,7 +107,11 @@
use-cgroups = true; use-cgroups = true;
}; };
boot.initrd.kernelModules = ["amdgpu" "sha256" "sha512"]; boot.initrd.kernelModules = [
"amdgpu"
"sha256"
"sha512"
];
# Processor settings for AMD # Processor settings for AMD
hardware.cpu.amd = { hardware.cpu.amd = {
@ -115,8 +125,12 @@
# Bootloader. # Bootloader.
boot.loader.systemd-boot = { boot.loader.systemd-boot = {
enable = true; enable = true;
edk2-uefi-shell = {enable = true;}; edk2-uefi-shell = {
memtest86 = {enable = true;}; enable = true;
};
memtest86 = {
enable = true;
};
configurationLimit = 3; configurationLimit = 3;
}; };
@ -139,7 +153,7 @@
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.videoDrivers = ["amdgpu"]; services.xserver.videoDrivers = [ "amdgpu" ];
services.xserver.updateDbusEnvironment = true; services.xserver.updateDbusEnvironment = true;
services.xserver.enableTearFree = true; services.xserver.enableTearFree = true;

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
qt = { qt = {
platformTheme = "qt5ct"; platformTheme = "qt5ct";
style = "kvantum"; style = "kvantum";

View file

@ -1,9 +1,9 @@
{pkgs, ...}: { { pkgs, ... }:
{
alqueva.users.unix = { alqueva.users.unix = {
shell = pkgs.zsh; shell = pkgs.zsh;
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
wget2 wget2
fastfetch fastfetch
btop-rocm btop-rocm
@ -29,21 +29,18 @@
man-pages-posix man-pages-posix
xwayland-satellite xwayland-satellite
; ;
inherit inherit (pkgs.nodePackages_latest)
(pkgs.nodePackages_latest)
nodejs nodejs
pnpm pnpm
; ;
inherit inherit (pkgs.llvmPackages_19)
(pkgs.llvmPackages_19)
libcxxClang libcxxClang
clangUseLLVM clangUseLLVM
clang-tools clang-tools
clang-manpages clang-manpages
openmp openmp
; ;
inherit inherit (pkgs.emacsPackages)
(pkgs.emacsPackages)
tree-sitter tree-sitter
tsc tsc
tree-sitter-langs tree-sitter-langs
@ -91,7 +88,7 @@
enableCompletion = true; enableCompletion = true;
autosuggestions = { autosuggestions = {
enable = true; enable = true;
strategy = ["completion"]; strategy = [ "completion" ];
}; };
zsh-autoenv = { zsh-autoenv = {
@ -100,7 +97,15 @@
syntaxHighlighting = { syntaxHighlighting = {
enable = true; enable = true;
highlighters = ["main" "brackets" "pattern" "cursor" "regexp" "root" "line"]; highlighters = [
"main"
"brackets"
"pattern"
"cursor"
"regexp"
"root"
"line"
];
}; };
shellAliases = { shellAliases = {
@ -111,7 +116,12 @@
ohMyZsh = { ohMyZsh = {
enable = true; enable = true;
plugins = ["git" "direnv" "fzf" "ssh-agent"]; plugins = [
"git"
"direnv"
"fzf"
"ssh-agent"
];
preLoaded = "zstyle :omz:plugins:ssh-agent agent-forwarding yes"; preLoaded = "zstyle :omz:plugins:ssh-agent agent-forwarding yes";
theme = "half-life"; theme = "half-life";
}; };

View file

@ -3,18 +3,19 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.alqueva.programs.sleep-or-die; cfg = config.alqueva.programs.sleep-or-die;
inherit (lib) mkOption mkEnableOption types mkIf; inherit (lib)
sleep-or-die = let mkOption
image = mkEnableOption
if cfg.image == null types
then "" mkIf
else "-i ${cfg.image}"; ;
sound = sleep-or-die =
if cfg.sound == null let
then "" image = if cfg.image == null then "" else "-i ${cfg.image}";
else "ffplay -nodisp -autoexit ${cfg.sound}"; sound = if cfg.sound == null then "" else "ffplay -nodisp -autoexit ${cfg.sound}";
in in
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "sod"; name = "sod";
@ -28,7 +29,8 @@
shutdown +60 "This was automatically invoked by 'sleep-or-die'" shutdown +60 "This was automatically invoked by 'sleep-or-die'"
''; '';
}; };
in { in
{
options.alqueva.programs.sleep-or-die = { options.alqueva.programs.sleep-or-die = {
enable = mkEnableOption "sleep-or-die"; enable = mkEnableOption "sleep-or-die";

View file

@ -3,12 +3,16 @@
config, config,
lib, lib,
... ...
}: let }:
let
ezaOptions = "--colour=always --icons=never --group-directories-first --octal-permissions"; ezaOptions = "--colour=always --icons=never --group-directories-first --octal-permissions";
cfg = config.alqueva.shells.aliases; cfg = config.alqueva.shells.aliases;
in { in
{
options.alqueva.shells.aliases = { options.alqueva.shells.aliases = {
enable = (lib.mkEnableOption "default aliases") // {default = true;}; enable = (lib.mkEnableOption "default aliases") // {
default = true;
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment = { environment = {

View file

@ -2,20 +2,23 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.alqueva.system.dconf; cfg = config.alqueva.system.dconf;
inherit (lib) types; inherit (lib) types;
in { in
{
options.alqueva.system.dconf = { options.alqueva.system.dconf = {
enable = lib.mkEnableOption "configuration with DConf"; enable = lib.mkEnableOption "configuration with DConf";
luminosity = lib.mkOption { luminosity = lib.mkOption {
type = types.enum ["dark" "light" "default"]; type = types.enum [
"dark"
"light"
"default"
];
default = "dark"; default = "dark";
description = "The luminosity you want to use for GTK."; description = "The luminosity you want to use for GTK.";
apply = lum: apply = lum: if lum == "default" then lum else "prefer-${lum}";
if lum == "default"
then lum
else "prefer-${lum}";
}; };
theme = lib.mkOption { theme = lib.mkOption {
type = types.str; type = types.str;
@ -43,20 +46,19 @@ in {
extraDconfPackages = lib.mkOption { extraDconfPackages = lib.mkOption {
type = types.listOf types.package; type = types.listOf types.package;
description = "Extra packages to install for DConf."; description = "Extra packages to install for DConf.";
default = []; default = [ ];
}; };
extraDconfSettings = lib.mkOption { extraDconfSettings = lib.mkOption {
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
description = "Extra settings you want to apply to DConf."; description = "Extra settings you want to apply to DConf.";
default = {}; default = { };
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.dconf = { programs.dconf = {
profiles.user.databases = [ profiles.user.databases = [
{ {
settings = settings = {
{
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = cfg.luminosity; color-scheme = cfg.luminosity;
cursor-size = cfg.cursor.size; cursor-size = cfg.cursor.size;
@ -64,8 +66,7 @@ in {
icon-theme = cfg.icon.theme; icon-theme = cfg.icon.theme;
gtk-theme = cfg.theme; gtk-theme = cfg.theme;
}; };
} } // cfg.extraDconfSettings;
// cfg.extraDconfSettings;
} }
]; ];
packages = cfg.extraDconfPackages; packages = cfg.extraDconfPackages;

View file

@ -1,8 +1,7 @@
{lib, ...}: { { lib, ... }:
{
imports = lib.pipe (builtins.readDir ./.) [ imports = lib.pipe (builtins.readDir ./.) [
(lib.filterAttrs (lib.filterAttrs (n: _v: n != "default.nix" && lib.last (lib.stringToCharacters n) != "~"))
(n: _v: n != "default.nix" && lib.last (lib.stringToCharacters n) != "~")) (lib.mapAttrsToList (n: _v: ./${n}))
(lib.mapAttrsToList
(n: _v: ./${n}))
]; ];
} }

View file

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

View file

@ -3,12 +3,14 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
cfg = config.alqueva.wms.niri; cfg = config.alqueva.wms.niri;
in { in
{
options.alqueva.wms.niri = { options.alqueva.wms.niri = {
enable = lib.mkEnableOption "niri"; enable = lib.mkEnableOption "niri";
package = lib.mkPackageOption pkgs "niri" {}; package = lib.mkPackageOption pkgs "niri" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -28,7 +30,7 @@ in {
]; ];
}; };
}; };
configPackages = [cfg.package]; configPackages = [ cfg.package ];
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-gnome pkgs.xdg-desktop-portal-gnome
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
@ -36,7 +38,7 @@ in {
}; };
services = { services = {
displayManager.sessionPackages = [cfg.package]; displayManager.sessionPackages = [ cfg.package ];
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
}; };

View file

@ -3,17 +3,19 @@
pkgs, pkgs,
config, config,
... ...
}: let }:
let
cfg = config.alqueva.shells.nushell; cfg = config.alqueva.shells.nushell;
in { in
{
options.alqueva.shells.nushell = { options.alqueva.shells.nushell = {
enable = lib.mkEnableOption "Nushell"; enable = lib.mkEnableOption "Nushell";
package = lib.mkPackageOption pkgs "nushell" {}; package = lib.mkPackageOption pkgs "nushell" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment = { environment = {
systemPackages = [cfg.package]; systemPackages = [ cfg.package ];
shells = [ shells = [
(lib.getExe' cfg.package "nu") (lib.getExe' cfg.package "nu")
"/run/current-system/sw/bin/nu" "/run/current-system/sw/bin/nu"

View file

@ -3,9 +3,11 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
cfg = config.alqueva.system.pipewire; cfg = config.alqueva.system.pipewire;
in { in
{
options.alqueva.system.pipewire = { options.alqueva.system.pipewire = {
enable = lib.mkEnableOption "PipeWire"; enable = lib.mkEnableOption "PipeWire";
}; };

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.alqueva.wms.river; cfg = config.alqueva.wms.river;
in { in
{
options.alqueva.wms.river = { options.alqueva.wms.river = {
enable = lib.mkEnableOption "River"; enable = lib.mkEnableOption "River";
}; };
@ -35,8 +37,7 @@ in {
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
wf-recorder wf-recorder
rofi-wayland rofi-wayland
kitty kitty

View file

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

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.alqueva.support; cfg = config.alqueva.support;
inherit (lib) mkEnableOption; inherit (lib) mkEnableOption;
in { in
{
options.alqueva.support = { options.alqueva.support = {
wayland = mkEnableOption "wayland support"; wayland = mkEnableOption "wayland support";
}; };

View file

@ -3,17 +3,23 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.alqueva.programs.swaybg; cfg = config.alqueva.programs.swaybg;
inherit (lib) types; inherit (lib) types;
in { in
{
options.alqueva.programs.swaybg = { options.alqueva.programs.swaybg = {
enable = lib.mkEnableOption "swaybg"; enable = lib.mkEnableOption "swaybg";
package = lib.mkPackageOption pkgs "swaybg" {}; package = lib.mkPackageOption pkgs "swaybg" { };
wallpaper = lib.mkOption { wallpaper = lib.mkOption {
default = ""; default = "";
description = "The wallpaper you want to use with swaybg."; description = "The wallpaper you want to use with swaybg.";
type = types.oneOf [types.str types.package types.path]; type = types.oneOf [
types.str
types.package
types.path
];
}; };
mode = lib.mkOption { mode = lib.mkOption {
default = "fill"; default = "fill";
@ -21,7 +27,7 @@ in {
type = types.str; type = types.str;
}; };
extraServiceConfig = { extraServiceConfig = {
default = {}; default = { };
description = "Extra settings you want to apply to the systemd service."; description = "Extra settings you want to apply to the systemd service.";
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
}; };
@ -31,9 +37,9 @@ in {
systemd.user.services.swaybg = { systemd.user.services.swaybg = {
inherit (cfg.package.meta) description; inherit (cfg.package.meta) description;
wantedBy = ["graphical-session.target"]; wantedBy = [ "graphical-session.target" ];
after = ["graphical-session-pre.target"]; after = [ "graphical-session-pre.target" ];
partOf = ["graphical-session.target"]; partOf = [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${lib.getExe' cfg.package "swaybg"} -i ${cfg.wallpaper} -m ${cfg.mode}"; ExecStart = "${lib.getExe' cfg.package "swaybg"} -i ${cfg.wallpaper} -m ${cfg.mode}";

View file

@ -2,27 +2,35 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) attrsOf listOf submodule str package; inherit (lib.types)
attrsOf
listOf
submodule
str
package
;
users = config.alqueva.users; users = config.alqueva.users;
in { in
{
options.alqueva.users = mkOption { options.alqueva.users = mkOption {
type = attrsOf (submodule { type = attrsOf (submodule {
options = { options = {
tmpfiles = mkOption { tmpfiles = mkOption {
description = "tmpfiles"; description = "tmpfiles";
type = listOf str; type = listOf str;
default = []; default = [ ];
}; };
packages = mkOption { packages = mkOption {
type = listOf package; type = listOf package;
default = []; default = [ ];
description = "Packages installed to the the defined user."; description = "Packages installed to the the defined user.";
}; };
groups = mkOption { groups = mkOption {
type = listOf str; type = listOf str;
default = []; default = [ ];
description = "Groups to add the defined user to."; description = "Groups to add the defined user to.";
}; };
shell = mkOption { shell = mkOption {
@ -30,30 +38,30 @@ in {
default = config.programs.bash.package; default = config.programs.bash.package;
description = "Shell the user wants to use."; description = "Shell the user wants to use.";
}; };
enable = (mkEnableOption "this user.") // {default = true;}; enable = (mkEnableOption "this user.") // {
default = true;
};
}; };
}); });
description = "Users to have on the system."; description = "Users to have on the system.";
default = {}; default = { };
}; };
config = let config =
let
enabledUsers = lib.filterAttrs (_: user: user.enable == true) users; enabledUsers = lib.filterAttrs (_: user: user.enable == true) users;
in { in
users.users = {
builtins.mapAttrs (un: uc: { users.users = builtins.mapAttrs (un: uc: {
description = un; description = un;
isNormalUser = true; isNormalUser = true;
extraGroups = uc.groups; extraGroups = uc.groups;
inherit (uc) packages shell; inherit (uc) packages shell;
initialPassword = "password"; initialPassword = "password";
}) }) enabledUsers;
enabledUsers;
systemd.user.tmpfiles.users = systemd.user.tmpfiles.users = builtins.mapAttrs (_: uc: {
builtins.mapAttrs (_: uc: {
rules = uc.tmpfiles; rules = uc.tmpfiles;
}) }) enabledUsers;
enabledUsers;
}; };
} }

View file

@ -3,15 +3,16 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
cfg = config.alqueva.shells.xonsh; cfg = config.alqueva.shells.xonsh;
aliasesToPyDict = aliases: aliasesToPyDict =
lib.concatStringsSep "\n" aliases: lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "aliases['${k}'] = '${v}'") aliases);
(lib.mapAttrsToList (k: v: "aliases['${k}'] = '${v}'") aliases); in
in { {
options.alqueva.shells.xonsh = { options.alqueva.shells.xonsh = {
enable = lib.mkEnableOption "xonsh"; enable = lib.mkEnableOption "xonsh";
package = lib.mkPackageOption pkgs "xonsh" {}; package = lib.mkPackageOption pkgs "xonsh" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -3,11 +3,11 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
environment = { environment = {
systemPackages = builtins.attrValues { systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
nil nil
statix statix
deadnix deadnix
@ -66,7 +66,7 @@
wrapProgram $out/bin/nh \ wrapProgram $out/bin/nh \
--set FLAKE "/home/artur/.config/nixos" --set FLAKE "/home/artur/.config/nixos"
''; '';
meta = {inherit (pkgs.nh.meta) mainProgram;}; meta = { inherit (pkgs.nh.meta) mainProgram; };
}; };
}; };
@ -99,9 +99,9 @@
xdg.mime = { xdg.mime = {
enable = true; enable = true;
defaultApplications = { defaultApplications = {
"text/html" = ["org.qutebrowser.qutebrowser.desktop"]; "text/html" = [ "org.qutebrowser.qutebrowser.desktop" ];
"x-scheme-handler/http" = ["org.qutebrowser.qutebrowser.desktop"]; "x-scheme-handler/http" = [ "org.qutebrowser.qutebrowser.desktop" ];
"x-scheme-handler/https" = ["org.qutebrowser.qutebrowser.desktop"]; "x-scheme-handler/https" = [ "org.qutebrowser.qutebrowser.desktop" ];
}; };
}; };
} }

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: { }:
{
imports = [ imports = [
./users/artur ./users/artur
./hardware.nix ./hardware.nix
@ -16,7 +17,7 @@
config = { config = {
boot = { boot = {
initrd.systemd.additionalUpstreamUnits = ["systemd-boot.service"]; initrd.systemd.additionalUpstreamUnits = [ "systemd-boot.service" ];
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;

View file

@ -14,7 +14,7 @@
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = ["defaults"]; mountOptions = [ "defaults" ];
}; };
}; };
luks = { luks = {
@ -28,7 +28,7 @@
}; };
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/@root" = { "/@root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -1,16 +1,17 @@
{pkgs, ...}: { { pkgs, ... }:
{
alqueva.system.fonts = { alqueva.system.fonts = {
names = { names = {
sansSerif = ["Iosevka"]; sansSerif = [ "Iosevka" ];
monospace = ["Iosevka"]; monospace = [ "Iosevka" ];
serif = ["IBM Plex Serif"]; serif = [ "IBM Plex Serif" ];
emoji = ["Twitter Color Emoji"]; emoji = [ "Twitter Color Emoji" ];
}; };
packages = { packages = {
sansSerif = [pkgs.inter]; sansSerif = [ pkgs.inter ];
monospace = [pkgs.iosevka]; monospace = [ pkgs.iosevka ];
serif = [pkgs.ibm-plex]; serif = [ pkgs.ibm-plex ];
emoji = [pkgs.twemoji-color-font]; emoji = [ pkgs.twemoji-color-font ];
extra = [ extra = [
pkgs.noto-fonts pkgs.noto-fonts
pkgs.nerd-fonts.symbols-only pkgs.nerd-fonts.symbols-only

View file

@ -1,7 +1,9 @@
{config, ...}: let { config, ... }:
let
cfg = config.services.forgejo; cfg = config.services.forgejo;
srv = cfg.settings.server; srv = cfg.settings.server;
in { in
{
services.nginx = { services.nginx = {
virtualHosts.${cfg.settings.server.DOMAIN} = { virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true; forceSSL = true;

View file

@ -6,15 +6,22 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = []; "nvme"
boot.kernelModules = ["kvm-amd"]; "xhci_pci"
boot.extraModulePackages = []; "ahci"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
config, config,
... ...
}: let }:
let
themes = { themes = {
# gtk-theme = pkgs.everforest-gtk-theme; # gtk-theme = pkgs.everforest-gtk-theme;
gtk-theme = pkgs.everforest-gtk-theme.overrideAttrs (finalAttrs: { gtk-theme = pkgs.everforest-gtk-theme.overrideAttrs (finalAttrs: {
@ -13,9 +14,7 @@
rev = "43cbe4f1aeba8b46e41836de4c8ea7ac398db119"; rev = "43cbe4f1aeba8b46e41836de4c8ea7ac398db119";
hash = "sha256-Z46i0Ihpzo4LhFvzKsvnzcHFzeYxJMvQmg2k6lmjGH0="; hash = "sha256-Z46i0Ihpzo4LhFvzKsvnzcHFzeYxJMvQmg2k6lmjGH0=";
}; };
nativeBuildInputs = nativeBuildInputs = (finalAttrs.nativeBuildInputs or [ ]) ++ [
(finalAttrs.nativeBuildInputs or [])
++ [
pkgs.sassc pkgs.sassc
]; ];
installPhase = '' installPhase = ''
@ -31,7 +30,8 @@
cursor-theme = pkgs.simp1e-cursors; cursor-theme = pkgs.simp1e-cursors;
}; };
cfg = config.alqueva.system.dconf; cfg = config.alqueva.system.dconf;
in { in
{
alqueva.system.dconf = { alqueva.system.dconf = {
enable = true; enable = true;
luminosity = "dark"; luminosity = "dark";

View file

@ -3,18 +3,22 @@
pkgs, pkgs,
config, config,
... ...
}: { }:
{
alqueva.users.artur = { alqueva.users.artur = {
shell = config.alqueva.shells.nushell.package; shell = config.alqueva.shells.nushell.package;
tmpfiles = [ tmpfiles = [
"L+ %h/.config/qutebrowser/config.py - - - - ${./configs/qutebrowser/config.py}" "L+ %h/.config/qutebrowser/config.py - - - - ${./configs/qutebrowser/config.py}"
"L+ %h/.config/qutebrowser/theme - - - - ${./configs/qutebrowser/theme}" "L+ %h/.config/qutebrowser/theme - - - - ${./configs/qutebrowser/theme}"
(let (
let
theme = pkgs.fetchurl { theme = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/deathbeam/base16-discord/refs/heads/main/themes/base16-nord.theme.css"; url = "https://raw.githubusercontent.com/deathbeam/base16-discord/refs/heads/main/themes/base16-nord.theme.css";
hash = "sha256-LofqgsVl+XKisk/dmb/PpwuLEWdEgchIfIw4xZs6LQw="; hash = "sha256-LofqgsVl+XKisk/dmb/PpwuLEWdEgchIfIw4xZs6LQw=";
}; };
in "L+ %h/.config/vesktop/themes/theme.user.css - - - - ${theme}") in
"L+ %h/.config/vesktop/themes/theme.user.css - - - - ${theme}"
)
"L+ %h/.config/vesktop/settings/quickCss.css - - - - ${./configs/vesktop/quickCss.css}" "L+ %h/.config/vesktop/settings/quickCss.css - - - - ${./configs/vesktop/quickCss.css}"
"L+ %h/.config/kanshi/ - - - - ${./configs/kanshi}" "L+ %h/.config/kanshi/ - - - - ${./configs/kanshi}"
"L+ %h/.config/dunst/ - - - - ${./configs/dunst}" "L+ %h/.config/dunst/ - - - - ${./configs/dunst}"
@ -25,8 +29,7 @@
"L+ %h/.face.icon - - - - ${./.face.icon}" "L+ %h/.face.icon - - - - ${./.face.icon}"
]; ];
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
eww eww
wget wget
vesktop-electron32 vesktop-electron32

View file

@ -2,21 +2,25 @@
inputs, inputs,
self, self,
... ...
}: { }:
flake.lib = let {
flake.lib =
let
inherit (inputs.nixpkgs.lib) nixosSystem; inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (builtins) mapAttrs; inherit (builtins) mapAttrs;
mkHost = { mkHost =
{
hostname, hostname,
system, system,
extraModules ? [], extraModules ? [ ],
extraSpecialArgs ? {}, extraSpecialArgs ? { },
}: }:
nixosSystem { nixosSystem {
inherit system; inherit system;
specialArgs = {inherit inputs self;} // extraSpecialArgs; specialArgs = {
modules = inherit inputs self;
[ } // extraSpecialArgs;
modules = [
../hosts/${hostname} ../hosts/${hostname}
self.nixosModules.default self.nixosModules.default
{ {
@ -44,14 +48,16 @@
}; };
systemd.oomd = { systemd.oomd = {
enableRootSlice = true; enableRootSlice = true;
extraConfig = {DefaultMemoryPressureDurationSec = "20s";}; extraConfig = {
DefaultMemoryPressureDurationSec = "20s";
};
}; };
} }
] ] ++ extraModules;
++ extraModules;
}; };
mkHosts = mapAttrs (hostname: args: mkHost (args // {inherit hostname;})); mkHosts = mapAttrs (hostname: args: mkHost (args // { inherit hostname; }));
in { in
{
inherit mkHosts; inherit mkHosts;
}; };
} }

View file

@ -1,17 +1,20 @@
{inputs, ...}: { { inputs, ... }:
{
imports = [ imports = [
inputs.git-hooks-nix.flakeModule inputs.git-hooks-nix.flakeModule
]; ];
perSystem = { perSystem =
{
config, config,
pkgs, pkgs,
... ...
}: { }:
{
pre-commit = { pre-commit = {
check.enable = true; check.enable = true;
settings.hooks = { settings.hooks = {
alejandra.enable = true; nixfmt-rfc-style.enable = true;
nil.enable = true; nil.enable = true;
shellcheck.enable = true; shellcheck.enable = true;
prettier.enable = true; prettier.enable = true;
@ -20,25 +23,24 @@
shfmt.enable = true; shfmt.enable = true;
deadnix = { deadnix = {
enable = true; enable = true;
args = ["-e"]; args = [ "-e" ];
}; };
statix = { statix = {
enable = true; enable = true;
args = ["fix"]; args = [ "fix" ];
}; };
}; };
}; };
devShells = { devShells = {
default = let default =
let
inherit (config) pre-commit; inherit (config) pre-commit;
in in
pkgs.mkShell { pkgs.mkShell {
name = "pre-commit-shell"; name = "pre-commit-shell";
shellHook = pre-commit.installationScript; shellHook = pre-commit.installationScript;
packages = packages = pre-commit.settings.enabledPackages ++ [
pre-commit.settings.enabledPackages
++ [
pre-commit.settings.package pre-commit.settings.package
pkgs.ruff-lsp pkgs.ruff-lsp
pkgs.bash-language-server pkgs.bash-language-server
@ -49,8 +51,7 @@
name = "haskell"; name = "haskell";
packages = builtins.attrValues { packages = builtins.attrValues {
inherit (pkgs) ghc; inherit (pkgs) ghc;
inherit inherit (pkgs.haskellPackages)
(pkgs.haskellPackages)
stack stack
haskell-language-server haskell-language-server
ormolu ormolu