treewide: format using nixfmt

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641c36f9763e104087a559c148d0449f00
This commit is contained in:
Bloxx12 2025-07-20 01:23:48 +02:00
commit e641dfa114
Signed by: faukah
SSH key fingerprint: SHA256:jpYIt4Vkz1NBTQcks/N9OPTfTFxE6KF2W/rV7hrfrIw
113 changed files with 1545 additions and 1019 deletions

View file

@ -10,14 +10,14 @@ let
inherit (lib.filesystem) listFilesRecursive; inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix; inherit (lib.strings) hasSuffix;
mkSystem = system: hostname: mkSystem =
system: hostname:
import (src.nixpkgs + "/nixos/lib/eval-config.nix") { import (src.nixpkgs + "/nixos/lib/eval-config.nix") {
specialArgs = { specialArgs = {
inherit sources; inherit sources;
self = ./.; self = ./.;
}; };
modules = modules = [
[
# This is used to pre-emptively set the hostPlatform for nixpkgs. # This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here. # Also, we set the system hostname here.
{ {
@ -27,10 +27,10 @@ let
./hosts/common.nix ./hosts/common.nix
./hosts/${hostname} ./hosts/${hostname}
] ]
++ ((listFilesRecursive ./modules) ++ ((listFilesRecursive ./modules) |> filter (hasSuffix ".mod.nix"));
|> filter (hasSuffix ".mod.nix"));
}; };
in { in
{
temperance = mkSystem "x86_64-linux" "temperance"; temperance = mkSystem "x86_64-linux" "temperance";
hermit = mkSystem "x86_64-linux" "hermit"; hermit = mkSystem "x86_64-linux" "hermit";
tower = mkSystem "aarch64-linux" "tower"; tower = mkSystem "aarch64-linux" "tower";

View file

@ -3,18 +3,19 @@
# No inputs, take this flakers # No inputs, take this flakers
outputs = _: let outputs =
_:
let
sources = import ./npins; sources = import ./npins;
nixpkgs = (import sources.flake-compat { src = sources.nixpkgs; }).outputs; nixpkgs = (import sources.flake-compat { src = sources.nixpkgs; }).outputs;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
pkgsFor = nixpkgs.legacyPackages; pkgsFor = nixpkgs.legacyPackages;
inputs = sources; inputs = sources;
in { in
{
nixosConfigurations = import ./default.nix; nixosConfigurations = import ./default.nix;
packages = packages = lib.mapAttrs (_: pkgs: {
lib.mapAttrs (
_: pkgs: {
inherit inherit
(import ./packages { (import ./packages {
inherit inputs pkgs sources; inherit inputs pkgs sources;
@ -24,21 +25,15 @@
kakoune kakoune
nushell nushell
; ;
} }) pkgsFor;
) devShells = lib.mapAttrs (_: pkgs: {
pkgsFor;
devShells =
lib.mapAttrs (
_: pkgs: {
default = pkgs.mkShellNoCC { default = pkgs.mkShellNoCC {
packages = [ packages = [
(pkgs.callPackage (sources.npins + "/npins.nix") { }) (pkgs.callPackage (sources.npins + "/npins.nix") { })
]; ];
env.NPINS_OVERRIDE_nichts = "."; env.NPINS_OVERRIDE_nichts = ".";
}; };
} }) pkgsFor;
)
pkgsFor;
templates = import ./templates; templates = import ./templates;
}; };

View file

@ -8,16 +8,17 @@
pkgs, pkgs,
sources, sources,
... ...
}: let }:
let
inherit (lib.meta) hiPrioSet; inherit (lib.meta) hiPrioSet;
helix = pkgs.callPackage (self + "/packages/helix") { inherit sources; }; helix = pkgs.callPackage (self + "/packages/helix") { inherit sources; };
fish = pkgs.callPackage (self + "/packages/fish") { inherit sources; }; fish = pkgs.callPackage (self + "/packages/fish") { inherit sources; };
in { in
{
environment.systemPackages = environment.systemPackages =
builtins.attrValues { builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
cachix cachix
calc calc
delta delta

View file

@ -3,7 +3,8 @@
nixpkgs, nixpkgs,
self, self,
... ...
}: let }:
let
inherit (builtins) filter map toString; inherit (builtins) filter map toString;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
inherit (lib.attrsets) recursiveUpdate; inherit (lib.attrsets) recursiveUpdate;
@ -14,20 +15,18 @@
# NOTE: This was inspired by raf, and I find this # NOTE: This was inspired by raf, and I find this
# to be quite a sane way of managing all modules in my flake. # to be quite a sane way of managing all modules in my flake.
mkSystem = { mkSystem =
{
system, system,
hostname, hostname,
... ...
}@args: }@args:
nixosSystem { nixosSystem {
specialArgs = specialArgs = recursiveUpdate {
recursiveUpdate
{
inherit lib; inherit lib;
inputs = sources; inputs = sources;
inherit self; inherit self;
} } args.specialArgs or { };
args.specialArgs or {};
modules = concatLists [ modules = concatLists [
# This is used to pre-emptively set the hostPlatform for nixpkgs. # This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here. # Also, we set the system hostname here.
@ -42,20 +41,15 @@
# common configuration, which all hosts share. # common configuration, which all hosts share.
(singleton ./common.nix) (singleton ./common.nix)
# Import all files called module.nix from my modules directory. # Import all files called module.nix from my modules directory.
( (map toString (listFilesRecursive ../modules) |> filter (hasSuffix "module.nix"))
map toString (listFilesRecursive ../modules) (map toString (listFilesRecursive ../modules) |> filter (hasSuffix ".mod.nix"))
|> filter (hasSuffix "module.nix")
)
(
map toString (listFilesRecursive ../modules)
|> filter (hasSuffix ".mod.nix")
)
] ]
|> flatten |> flatten
) )
]; ];
}; };
in { in
{
temperance = mkSystem { temperance = mkSystem {
system = "x86_64-linux"; system = "x86_64-linux";
hostname = "temperance"; hostname = "temperance";

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
# Time Zone # Time Zone
time.timeZone = "Europe/Zurich"; time.timeZone = "Europe/Zurich";
# Select internationalisation properties. # Select internationalisation properties.

View file

@ -1,6 +1,7 @@
{ {
config = { config = {
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581"; boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581";
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/5D7D-FC52"; device = "/dev/disk/by-uuid/5D7D-FC52";
@ -10,17 +11,28 @@
"/" = { "/" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["compress=zstd" "noatime"]; options = [
"compress=zstd"
"noatime"
];
}; };
"/nix" = { "/nix" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"]; options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
}; };
"/home" = { "/home" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home" "compress=zstd" "noatime"]; options = [
"subvol=home"
"compress=zstd"
"noatime"
];
}; };
}; };
# swapDevices = [ # swapDevices = [

View file

@ -6,18 +6,31 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot = { boot = {
initrd = { initrd = {
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ]; kernelModules = [ ];
}; };
kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
blacklistedKernelModules = ["nouveau" "nvidia" "nvidia_drm" "nvidia_modeset"]; blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
];
kernelParams = [ "mem_sleep_default=deep" ]; kernelParams = [ "mem_sleep_default=deep" ];
extraModulePackages = [ ]; extraModulePackages = [ ];

View file

@ -3,8 +3,10 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
xanmod_custom = callPackage ./xanmod.nix; xanmod_custom = callPackage ./xanmod.nix;
in { in
{
boot.kernelPackages = xanmod_custom; boot.kernelPackages = xanmod_custom;
} }

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let { pkgs, ... }:
let
# a newer nil version, for pipes support. # a newer nil version, for pipes support.
new-nil = pkgs.nil.overrideAttrs (_: { new-nil = pkgs.nil.overrideAttrs (_: {
version = "unstable-18-07-2025"; version = "unstable-18-07-2025";
@ -17,10 +18,10 @@
hash = "sha256-Sljr3ff8hl/qm/0wqc1GXsEr1wWn7NAXmdrd5wHzUX8="; hash = "sha256-Sljr3ff8hl/qm/0wqc1GXsEr1wWn7NAXmdrd5wHzUX8=";
}; };
}); });
in { in
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
abook abook
aerc aerc
aichat aichat

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
# Time Zone # Time Zone
time.timeZone = "Europe/Zurich"; time.timeZone = "Europe/Zurich";
# Select internationalisation properties. # Select internationalisation properties.

View file

@ -1,6 +1,7 @@
{ {
config = { config = {
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/96e8f3d6-8d2d-4e2d-abd9-3eb7f48fed02"; boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/96e8f3d6-8d2d-4e2d-abd9-3eb7f48fed02";
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/B3AC-9050"; device = "/dev/disk/by-uuid/B3AC-9050";
@ -10,29 +11,49 @@
"/" = { "/" = {
device = "none"; device = "none";
fsType = "tmpfs"; fsType = "tmpfs";
options = ["defaults" "size=40%" "mode=755"]; options = [
"defaults"
"size=40%"
"mode=755"
];
}; };
"/nix" = { "/nix" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548"; device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"]; options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
}; };
"/persist" = { "/persist" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548"; device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
neededForBoot = true; neededForBoot = true;
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=persist" "compress=zstd" "noatime"]; options = [
"subvol=persist"
"compress=zstd"
"noatime"
];
}; };
"/home" = { "/home" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548"; device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home" "compress=zstd" "noatime"]; options = [
"subvol=home"
"compress=zstd"
"noatime"
];
}; };
"/swap" = { "/swap" = {
device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548"; device = "/dev/disk/by-uuid/f0569993-722e-4721-b0d9-8ac537a7a548";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=swap" "compress=lzo" "noatime"]; options = [
"subvol=swap"
"compress=lzo"
"noatime"
];
}; };
}; };
swapDevices = [ swapDevices = [

View file

@ -3,11 +3,18 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = { boot = {
initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
];
initrd.kernelModules = [ ]; initrd.kernelModules = [ ];
kernelModules = [ ]; kernelModules = [ ];
extraModulePackages = [ ]; extraModulePackages = [ ];
@ -21,6 +28,5 @@
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -3,8 +3,10 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
xanmod_custom = callPackage ./xanmod.nix; xanmod_custom = callPackage ./xanmod.nix;
in { in
{
boot.kernelPackages = xanmod_custom; boot.kernelPackages = xanmod_custom;
} }

View file

@ -1,8 +1,10 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.kernel) no unset; inherit (lib.kernel) no unset;
inherit (lib.attrsets) mapAttrs; inherit (lib.attrsets) mapAttrs;
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in
{
boot.kernelPatches = [ boot.kernelPatches = [
{ {
name = "disable-unused-features"; name = "disable-unused-features";

View file

@ -4,7 +4,8 @@
buildLinux, buildLinux,
kernelPatches, kernelPatches,
... ...
}: let }:
let
pname = "linux-xanmod"; pname = "linux-xanmod";
version = "6.11.5"; version = "6.11.5";
vendorSuffix = "xanmod1"; vendorSuffix = "xanmod1";
@ -58,17 +59,17 @@
}; };
}) })
# 1:1 taken from raf's custom kernel, check out his config for this. # 1:1 taken from raf's custom kernel, check out his config for this.
.overrideAttrs (oa: { .overrideAttrs
prePatch = (oa: {
oa.prePatch or "" prePatch = oa.prePatch or "" + ''
+ ''
# bragging rights # bragging rights
echo "Replacing localversion with custom suffix" echo "Replacing localversion with custom suffix"
substituteInPlace localversion \ substituteInPlace localversion \
--replace-fail "xanmod1" "blox" --replace-fail "xanmod1" "blox"
''; '';
}); });
in { in
{
inherit inherit
xanmod_blox xanmod_blox
; ;

View file

@ -1,7 +1,7 @@
{pkgs, ...}: { { pkgs, ... }:
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
alsa-utils alsa-utils
anki anki
asciinema asciinema

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
# Time Zone # Time Zone
time.timeZone = "Europe/Vienna"; time.timeZone = "Europe/Vienna";
# Select internationalisation properties. # Select internationalisation properties.

View file

@ -2,13 +2,18 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot = { boot = {
initrd.availableKernelModules = ["xhci_pci" "virtio_scsi" "sr_mod"]; initrd.availableKernelModules = [
"xhci_pci"
"virtio_scsi"
"sr_mod"
];
initrd.kernelModules = [ ]; initrd.kernelModules = [ ];
kernelModules = [ ]; kernelModules = [ ];
extraModulePackages = [ ]; extraModulePackages = [ ];

View file

@ -1,7 +1,7 @@
{pkgs, ...}: { { pkgs, ... }:
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
; ;
}; };
} }

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
# Time Zone # Time Zone
time.timeZone = "Europe/Zurich"; time.timeZone = "Europe/Zurich";
# Select internationalisation properties. # Select internationalisation properties.

View file

@ -1,6 +1,7 @@
{ {
config = { config = {
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581"; boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/10318654-ed20-43f6-885d-35366a427581";
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/5D7D-FC52"; device = "/dev/disk/by-uuid/5D7D-FC52";
@ -10,17 +11,28 @@
"/" = { "/" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["compress=zstd" "noatime"]; options = [
"compress=zstd"
"noatime"
];
}; };
"/nix" = { "/nix" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"]; options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
}; };
"/home" = { "/home" = {
device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e"; device = "/dev/disk/by-uuid/e353013b-8ac7-40ed-80f2-ddbea21b8d5e";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home" "compress=zstd" "noatime"]; options = [
"subvol=home"
"compress=zstd"
"noatime"
];
}; };
}; };
# swapDevices = [ # swapDevices = [

View file

@ -3,7 +3,8 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
# (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") # (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@ -11,11 +12,23 @@
boot = { boot = {
initrd = { initrd = {
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ]; kernelModules = [ ];
}; };
kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
blacklistedKernelModules = ["nouveau" "nvidia" "nvidia_drm" "nvidia_modeset"]; blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
];
kernelParams = [ "mem_sleep_default=deep" ]; kernelParams = [ "mem_sleep_default=deep" ];
extraModulePackages = [ ]; extraModulePackages = [ ];

View file

@ -2,10 +2,10 @@
self, self,
pkgs, pkgs,
... ...
}: { }:
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
calc calc
comma comma
difftastic difftastic

View file

@ -1,7 +1,15 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) submodule int ints number attrsOf; inherit (lib.types)
in { submodule
int
ints
number
attrsOf
;
in
{
options.modules.system.hardware.monitors = mkOption { options.modules.system.hardware.monitors = mkOption {
description = "\n List of monitors to use\n "; description = "\n List of monitors to use\n ";
default = { }; default = { };

View file

@ -2,14 +2,22 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (builtins) elemAt; inherit (builtins) elemAt;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) enum listOf str nullOr bool; inherit (lib.types)
enum
listOf
str
nullOr
bool
;
inherit (lib.lists) elem; inherit (lib.lists) elem;
inherit (config.modules.system) systemType; inherit (config.modules.system) systemType;
in { in
{
options.modules.system = { options.modules.system = {
users = mkOption { users = mkOption {
type = listOf str; type = listOf str;
@ -27,7 +35,11 @@ in {
}; };
systemType = mkOption { systemType = mkOption {
type = nullOr (enum ["desktop" "laptop" "server"]); type = nullOr (enum [
"desktop"
"laptop"
"server"
]);
default = null; default = null;
description = '' description = ''
The type of the current system. This is used to determine whether things like graphical The type of the current system. This is used to determine whether things like graphical
@ -37,7 +49,10 @@ in {
isGraphical = mkOption { isGraphical = mkOption {
type = bool; type = bool;
default = elem systemType ["desktop" "laptop"]; default = elem systemType [
"desktop"
"laptop"
];
description = '' description = ''
Whether the current system is a graphical system. Whether the current system is a graphical system.
''; '';
@ -46,7 +61,10 @@ in {
yubikeySupport = { yubikeySupport = {
enable = mkEnableOption "yubikey support"; enable = mkEnableOption "yubikey support";
deviceType = mkOption { deviceType = mkOption {
type = nullOr (enum ["NFC5" "nano"]); type = nullOr (enum [
"NFC5"
"nano"
]);
default = null; default = null;
description = "A list of device models to enable Yubikey support for"; description = "A list of device models to enable Yubikey support for";
}; };

View file

@ -1,7 +1,9 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.types) str enum; inherit (lib.types) str enum;
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
in { in
{
options.modules.system.programs = { options.modules.system.programs = {
editors = { editors = {
helix.enable = mkEnableOption "Helix text editor"; helix.enable = mkEnableOption "Helix text editor";
@ -27,23 +29,42 @@ in {
}; };
default = { default = {
terminal = mkOption { terminal = mkOption {
type = enum ["foot" "kitty"]; type = enum [
"foot"
"kitty"
];
default = "foot"; default = "foot";
}; };
fileManager = mkOption { fileManager = mkOption {
type = enum ["thunar" "dolphin" "nemo"]; type = enum [
"thunar"
"dolphin"
"nemo"
];
default = "thunar"; default = "thunar";
}; };
browser = mkOption { browser = mkOption {
type = enum ["firefox" "librewolf" "chromium"]; type = enum [
"firefox"
"librewolf"
"chromium"
];
default = "firefox"; default = "firefox";
}; };
editor = mkOption { editor = mkOption {
type = enum ["neovim" "helix" "emacs"]; type = enum [
"neovim"
"helix"
"emacs"
];
default = "emacs"; default = "emacs";
}; };
launcher = mkOption { launcher = mkOption {
type = enum ["anyrun" "rofi" "wofi"]; type = enum [
"anyrun"
"rofi"
"wofi"
];
default = "anyrun"; default = "anyrun";
}; };
}; };

View file

@ -1,7 +1,8 @@
{pkgs, ...}: let { pkgs, ... }:
key = let
pkgs.writeText "signingkey" "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw=="; key = pkgs.writeText "signingkey" "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw==";
in { in
{
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;

View file

@ -1,7 +1,9 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) str; inherit (lib.types) str;
in { in
{
options.modules.other.system = { options.modules.other.system = {
username = mkOption { username = mkOption {
description = "username for this system"; description = "username for this system";

View file

@ -4,14 +4,16 @@
pkgs, pkgs,
self, self,
... ...
}: let }:
let
inherit (builtins) elemAt; inherit (builtins) elemAt;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) listOf str package; inherit (lib.types) listOf str package;
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
nushell = pkgs.callPackage (self + "/packages/nushell") { }; nushell = pkgs.callPackage (self + "/packages/nushell") { };
in { in
{
options.meta = { options.meta = {
users = mkOption { users = mkOption {
type = listOf str; type = listOf str;

View file

@ -2,7 +2,8 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
primary_browser = "Librewolf.desktop"; primary_browser = "Librewolf.desktop";
@ -13,7 +14,8 @@
text_editor = "helix.desktop"; text_editor = "helix.desktop";
terminal = "foot.desktop"; terminal = "foot.desktop";
pdf_viewer = "zathura.desktop"; pdf_viewer = "zathura.desktop";
in { in
{
environment = { environment = {
systemPackages = [ pkgs.xdg-utils ]; systemPackages = [ pkgs.xdg-utils ];
variables = { variables = {

View file

@ -0,0 +1,13 @@
{
pkgs,
sources,
...
}:
let
nixfmt = pkgs.callPackage "${sources.nixfmt}/default.nix" { };
in
{
environment.systemPackages = [
nixfmt
];
}

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
toml = pkgs.formats.toml { }; toml = pkgs.formats.toml { };
@ -14,11 +15,20 @@
}; };
ui = { ui = {
pager = ["${getExe pkgs.bat}" "--plain"]; pager = [
"${getExe pkgs.bat}"
"--plain"
];
default-command = "log"; default-command = "log";
movement.edit = true; movement.edit = true;
diff.tool = ["${getExe pkgs.difftastic}" "--color" "always" "$left" "$right"]; diff.tool = [
"${getExe pkgs.difftastic}"
"--color"
"always"
"$left"
"$right"
];
}; };
# FIXME: do this with agenix # FIXME: do this with agenix
# "--scope" = [ # "--scope" = [
@ -44,26 +54,52 @@
signing = { signing = {
behaviour = "own"; behaviour = "own";
backend = "ssh"; backend = "ssh";
key = ["ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw=="]; key = [
"ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw=="
];
}; };
aliases = { aliases = {
c = [ "commit" ]; c = [ "commit" ];
ci = ["commit" "--interactive"]; ci = [
"commit"
"--interactive"
];
e = [ "edit" ]; e = [ "edit" ];
# "new bookmark" # "new bookmark"
nb = ["bookmark" "create" "-r @-"]; nb = [
"bookmark"
"create"
"-r @-"
];
pull = ["git" "fetch"]; pull = [
push = ["git" "push" "--allow-new"]; "git"
"fetch"
];
push = [
"git"
"push"
"--allow-new"
];
r = [ "rebase" ]; r = [ "rebase" ];
s = [ "squash" ]; s = [ "squash" ];
si = ["squash" "--interactive"]; si = [
"squash"
"--interactive"
];
tug = ["bookmark" "move" "--from" "closest_bookmark(@-)" "--to" "@-"]; tug = [
"bookmark"
"move"
"--from"
"closest_bookmark(@-)"
"--to"
"@-"
];
}; };
revset-aliases = { revset-aliases = {
"closest_bookmark(to)" = "heads(::to & bookmarks())"; "closest_bookmark(to)" = "heads(::to & bookmarks())";
@ -97,6 +133,7 @@
''; '';
}; };
in { in
{
# environment.systemPackages = [jj-wrapped]; # environment.systemPackages = [jj-wrapped];
} }

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
sources, sources,
... ...
}: let }:
let
cfg = config.modules.programs.nh; cfg = config.modules.programs.nh;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
@ -12,7 +13,8 @@
nh = (pkgs.callPackage "${sources.nh}/package.nix" { }).overrideAttrs (_: { nh = (pkgs.callPackage "${sources.nh}/package.nix" { }).overrideAttrs (_: {
doInstallCheck = false; doInstallCheck = false;
}); });
in { in
{
options.modules.programs.nh.enable = mkEnableOption "nh"; options.modules.programs.nh.enable = mkEnableOption "nh";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (config.modules.system) isGraphical; inherit (config.modules.system) isGraphical;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
@ -16,12 +17,12 @@
BITWARDEN_SSH_AUTH_SOCK /run/user/1000/ssh-agent.sock BITWARDEN_SSH_AUTH_SOCK /run/user/1000/ssh-agent.sock
''; '';
}; };
in { in
{
config = mkIf isGraphical { config = mkIf isGraphical {
environment = { environment = {
systemPackages = lib.attrValues { systemPackages = lib.attrValues {
inherit inherit (pkgs)
(pkgs)
bitwarden-cli bitwarden-cli
; ;
inherit bitwarden-desktop-wrapped; inherit bitwarden-desktop-wrapped;

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.lists) map; inherit (lib.lists) map;
inherit (lib.strings) concatStringsSep; inherit (lib.strings) concatStringsSep;
@ -20,16 +21,15 @@
brave-wrapped = pkgs.symlinkJoin { brave-wrapped = pkgs.symlinkJoin {
name = "brave"; name = "brave";
paths = [ paths = [
( (pkgs.brave.override { vulkanSupport = true; })
pkgs.brave.override {vulkanSupport = true;}
)
]; ];
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = '' postBuild = ''
wrapProgram $out/bin/brave --append-flags "${flags}" wrapProgram $out/bin/brave --append-flags "${flags}"
''; '';
}; };
in { in
{
environment.systemPackages = [ environment.systemPackages = [
brave-wrapped brave-wrapped
]; ];

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (config.modules.system) isGraphical; inherit (config.modules.system) isGraphical;
in { in
{
config = mkIf isGraphical { config = mkIf isGraphical {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kdePackages.dolphin kdePackages.dolphin

View file

@ -3,14 +3,16 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
cfg = config.modules.system.programs.terminals.foot; cfg = config.modules.system.programs.terminals.foot;
theme-colors = config.modules.style.colorScheme.colors; theme-colors = config.modules.style.colorScheme.colors;
foot-config = pkgs.writeText "foot.ini" (lib.generators.toINI {} { foot-config = pkgs.writeText "foot.ini" (
lib.generators.toINI { } {
main = { main = {
term = "xterm-256color"; term = "xterm-256color";
app-id = "foot"; app-id = "foot";
@ -123,7 +125,8 @@
alpha = 0.9; alpha = 0.9;
}; };
}); }
);
foot-wrapped = pkgs.symlinkJoin { foot-wrapped = pkgs.symlinkJoin {
name = "foot-wrapped"; name = "foot-wrapped";
paths = [ pkgs.foot ]; paths = [ pkgs.foot ];
@ -132,7 +135,8 @@
wrapProgram $out/bin/foot --add-flags "--config=${foot-config} --working-directory=/home/${username}" wrapProgram $out/bin/foot --add-flags "--config=${foot-config} --working-directory=/home/${username}"
''; '';
}; };
in { in
{
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ foot-wrapped ]; environment.systemPackages = [ foot-wrapped ];
}; };

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.lists) elem; inherit (lib.lists) elem;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
@ -15,9 +16,16 @@
# Shell integration for ghostty only supports # Shell integration for ghostty only supports
# bash, fish and zsh for now. # bash, fish and zsh for now.
shell-integration = shell-integration =
if elem name ["bash" "fish" "zsh"] if
then name elem name [
else "none"; "bash"
"fish"
"zsh"
]
then
name
else
"none";
ghostty-settings = { ghostty-settings = {
font-size = 14; font-size = 14;
@ -53,7 +61,10 @@
command = getExe package; command = getExe package;
}; };
settingsFile = pkgs.writeText "config" <| concatStringsSep "\n" <| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings; settingsFile =
pkgs.writeText "config"
<| concatStringsSep "\n"
<| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings;
ghostty-wrapped = pkgs.symlinkJoin { ghostty-wrapped = pkgs.symlinkJoin {
name = "ghostty-wrapped"; name = "ghostty-wrapped";
@ -63,7 +74,8 @@
wrapProgram $out/bin/ghostty --add-flags "--config-file=${settingsFile}" wrapProgram $out/bin/ghostty --add-flags "--config-file=${settingsFile}"
''; '';
}; };
in { in
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit ghostty-wrapped; inherit ghostty-wrapped;
}; };

View file

@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.programs.minecraft; cfg = config.modules.programs.minecraft;
in { in
{
options.modules.programs.minecraft = { options.modules.programs.minecraft = {
enable = mkEnableOption "minecraft"; enable = mkEnableOption "minecraft";
wayland = mkEnableOption "wayland"; wayland = mkEnableOption "wayland";

View file

@ -1,6 +1,6 @@
{pkgs, ...}: { { pkgs, ... }:
environment.systemPackages = {
[ environment.systemPackages = [
pkgs.spotify pkgs.spotify
] ]
++ (with pkgs; [ ++ (with pkgs; [

View file

@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.programs.steam; cfg = config.modules.system.programs.steam;
in { in
{
options.modules.system.programs.steam.enable = mkEnableOption "Steam games platform"; options.modules.system.programs.steam.enable = mkEnableOption "Steam games platform";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.steam = { programs.steam = {
@ -19,7 +21,8 @@ in {
SDL_VIDEODRIVER = "x11"; SDL_VIDEODRIVER = "x11";
}; };
extraLibraries = p: extraLibraries =
p:
builtins.attrValues { builtins.attrValues {
inherit (p) atk; inherit (p) atk;
}; };

View file

@ -3,18 +3,19 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.programs.thunar; cfg = config.modules.programs.thunar;
in { in
{
options.modules.programs.thunar.enable = mkEnableOption "Thunar file manager"; options.modules.programs.thunar.enable = mkEnableOption "Thunar file manager";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.thunar = { programs.thunar = {
enable = true; enable = true;
plugins = builtins.attrValues { plugins = builtins.attrValues {
inherit inherit (pkgs.xfce)
(pkgs.xfce)
thunar-volman thunar-volman
thunar-vcs-plugin thunar-vcs-plugin
thunar-archive-plugin thunar-archive-plugin

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
config = { config = {
programs.direnv = { programs.direnv = {
enable = true; enable = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs = { programs = {
# We have to disable this and use nix-index instead. (Rust >>> Pearl) # We have to disable this and use nix-index instead. (Rust >>> Pearl)
command-not-found = { command-not-found = {

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
@ -39,7 +40,8 @@
wrapProgram $out/bin/btop --set XDG_CONFIG_HOME "${btop-settings}" wrapProgram $out/bin/btop --set XDG_CONFIG_HOME "${btop-settings}"
''; '';
}; };
in { in
{
options.modules.programs.btop.enable = mkEnableOption "btop"; options.modules.programs.btop.enable = mkEnableOption "btop";
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ btop-wrapped ]; environment.systemPackages = [ btop-wrapped ];

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let { pkgs, ... }:
let
zellij-wrapped = pkgs.symlinkJoin { zellij-wrapped = pkgs.symlinkJoin {
name = "zellij-wrapped"; name = "zellij-wrapped";
paths = [ pkgs.zellij ]; paths = [ pkgs.zellij ];
@ -8,7 +9,8 @@
--config ${./config.kdl}" --config ${./config.kdl}"
''; '';
}; };
in { in
{
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit zellij-wrapped; inherit zellij-wrapped;
}; };

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
mkAcmeCert = domain: { mkAcmeCert = domain: {
# An acme system user is created. This user belongs to the acme group # An acme system user is created. This user belongs to the acme group
# and the home directory is /var/lib/acme. This user will try to make the directory # and the home directory is /var/lib/acme. This user will try to make the directory
@ -15,7 +16,8 @@
email = "charlie@charlieroot.dev"; email = "charlie@charlieroot.dev";
group = "nginx"; group = "nginx";
}; };
in { in
{
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults = { defaults = {

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (pkgs) fetchurl; inherit (pkgs) fetchurl;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
@ -16,7 +17,8 @@
img = ./img; img = ./img;
dataDir = "/srv/data/forgejo"; dataDir = "/srv/data/forgejo";
dumpDir = "/srv/data/forgejo-dump"; dumpDir = "/srv/data/forgejo-dump";
in { in
{
options.modules.system.services.forgejo.enable = mkEnableOption "forgejo"; options.modules.system.services.forgejo.enable = mkEnableOption "forgejo";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -113,7 +115,8 @@ in {
}; };
}; };
systemd.tmpfiles.rules = let systemd.tmpfiles.rules =
let
# no crawlers, thank you. # no crawlers, thank you.
robots = pkgs.writeText "robots-txt" '' robots = pkgs.writeText "robots-txt" ''
User-agent: * User-agent: *
@ -131,7 +134,8 @@ in {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/theme-codeberg-dark.css"; url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/theme-codeberg-dark.css";
hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs="; hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs=";
}; };
in [ in
[
"d '${customDir}/public' 0750 ${user} ${group} - -" "d '${customDir}/public' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets' 0750 ${user} ${group} - -" "d '${customDir}/public/assets' 0750 ${user} ${group} - -"
"d '${customDir}/public/assets/img' 0750 ${user} ${group} - -" "d '${customDir}/public/assets/img' 0750 ${user} ${group} - -"

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (builtins) fetchurl; inherit (builtins) fetchurl;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
@ -11,7 +12,8 @@
cfg = config.modules.system.services.grafana; cfg = config.modules.system.services.grafana;
domain = "info.copeberg.org"; domain = "info.copeberg.org";
port = 4021; port = 4021;
in { in
{
options.modules.system.services.grafana.enable = mkEnableOption "Grafana, a graphing service"; options.modules.system.services.grafana.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.meta) getExe getExe'; inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
@ -12,7 +13,8 @@
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
cfg = config.modules.services.greetd; cfg = config.modules.services.greetd;
uwsmEnabled = config.modules.services.uwsm.enable; uwsmEnabled = config.modules.services.uwsm.enable;
in { in
{
options.modules.services.greetd = { options.modules.services.greetd = {
enable = mkEnableOption "greetd"; enable = mkEnableOption "greetd";
greeter = mkOption { greeter = mkOption {
@ -27,14 +29,13 @@ in {
description = "Which login session to start"; description = "Which login session to start";
type = str; type = str;
default = default =
if uwsmEnabled if uwsmEnabled then "${getExe config.programs.uwsm.package} start Hyprland" else "Hyprland";
then "${getExe config.programs.uwsm.package} start Hyprland"
else "Hyprland";
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.greetd = let services.greetd =
let
session = { session = {
# command = '' # command = ''
# ${pkgs.greetd.tuigreet}/bin/tuigreet \ # ${pkgs.greetd.tuigreet}/bin/tuigreet \
@ -46,7 +47,8 @@ in {
command = "${getExe config.programs.uwsm.package} start hyprland-uwsm.desktop"; command = "${getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
user = username; user = username;
}; };
in { in
{
enable = true; enable = true;
package = pkgs.greetd; package = pkgs.greetd;
vt = 7; vt = 7;

View file

@ -2,12 +2,14 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.services.kanata; cfg = config.modules.services.kanata;
in { in
{
options.modules.services.kanata.enable = mkEnableOption "kanata"; options.modules.services.kanata.enable = mkEnableOption "kanata";
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.kanata = { services.kanata = {

View file

@ -3,11 +3,13 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.modules.services.locate; cfg = config.modules.services.locate;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in
{
options.modules.services.locate.enable = mkEnableOption "Locate service"; options.modules.services.locate.enable = mkEnableOption "Locate service";
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.plocate ]; environment.systemPackages = [ pkgs.plocate ];

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let { pkgs, ... }:
let
mako-wrapped = pkgs.symlinkJoin { mako-wrapped = pkgs.symlinkJoin {
name = "mako-wrapped"; name = "mako-wrapped";
paths = [ pkgs.mako ]; paths = [ pkgs.mako ];
@ -12,6 +13,7 @@
--default-timeout 4000" --default-timeout 4000"
''; '';
}; };
in { in
{
environment.systemPackages = [ mako-wrapped ]; environment.systemPackages = [ mako-wrapped ];
} }

View file

@ -3,14 +3,16 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.loki; cfg = config.modules.system.services.loki;
port = 4026; port = 4026;
dataDir = "/srv/data/loki"; dataDir = "/srv/data/loki";
in { in
{
options.modules.system.services.loki.enable = mkEnableOption "Grafana, a graphing service"; options.modules.system.services.loki.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -3,13 +3,15 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.modules.services.media.mpd; cfg = config.modules.services.media.mpd;
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.types) str; inherit (lib.types) str;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
in { in
{
options.modules.services = { options.modules.services = {
media = { media = {
mpd = { mpd = {

View file

@ -3,11 +3,13 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf mkDefault; inherit (lib.modules) mkIf mkDefault;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.nginx; cfg = config.modules.system.services.nginx;
in { in
{
options.modules.system.services.nginx.enable = mkEnableOption "nginx"; options.modules.system.services.nginx.enable = mkEnableOption "nginx";
config = mkIf cfg.enable { config = mkIf cfg.enable {
security = { security = {

View file

@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.meta) getExe'; inherit (lib.meta) getExe';
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.system.services.owncloud; cfg = config.modules.system.services.owncloud;
in { in
{
options.modules.system.services.owncloud.enable = lib.mkEnableOption "owncloud"; options.modules.system.services.owncloud.enable = lib.mkEnableOption "owncloud";
config = { config = {

View file

@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.modules.system.sound; cfg = config.modules.system.sound;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
in { in
{
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.pulseaudio.enable = false; services.pulseaudio.enable = false;
services.pipewire = { services.pipewire = {

View file

@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.database.postgresql; cfg = config.modules.system.services.database.postgresql;
in { in
{
options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql"; options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in
{
options.modules.services.cups.enable = mkEnableOption "CUPS, the Common UNIX printing system"; options.modules.services.cups.enable = mkEnableOption "CUPS, the Common UNIX printing system";
config = { config = {

View file

@ -3,13 +3,15 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.prometheus; cfg = config.modules.system.services.prometheus;
port = 4022; port = 4022;
in { in
{
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service"; options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -22,7 +24,10 @@ in {
node = { node = {
enable = true; enable = true;
port = 4023; port = 4023;
enabledCollectors = ["systemd" "processes"]; enabledCollectors = [
"systemd"
"processes"
];
}; };
postgres = { postgres = {
@ -44,17 +49,23 @@ in {
{ {
job_name = "node"; job_name = "node";
scrape_interval = "30s"; scrape_interval = "30s";
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];}]; static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
];
} }
{ {
job_name = "postgres"; job_name = "postgres";
scrape_interval = "30s"; scrape_interval = "30s";
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];}]; static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.postgres.port}" ]; }
];
} }
{ {
job_name = "nginx"; job_name = "nginx";
scrape_interval = "30s"; scrape_interval = "30s";
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];}]; static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.nginx.port}" ]; }
];
} }
]; ];
}; };

View file

@ -2,15 +2,17 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (config.modules.system) isGraphical; inherit (config.modules.system) isGraphical;
in { in
{
# TODO: setup # TODO: setup
services.spotifyd = mkIf isGraphical { services.spotifyd = mkIf isGraphical {
enable = true; enable = true;
settings = { settings = {
backend = "pipe"; # backend = "pipe";
}; };
}; };
} }

View file

@ -1,6 +1,8 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in
{
options.modules.programs.ssh.enable = mkEnableOption "ssh"; options.modules.programs.ssh.enable = mkEnableOption "ssh";
config = { config = {
services.openssh = { services.openssh = {

View file

@ -3,14 +3,16 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
domain = "charlieroot.dev"; domain = "charlieroot.dev";
cfg = config.modules.system.services.stalwart; cfg = config.modules.system.services.stalwart;
in { in
{
options.modules.system.services.stalwart.enable = mkEnableOption "stalwart"; options.modules.system.services.stalwart.enable = mkEnableOption "stalwart";
config = mkIf cfg.enable { config = mkIf cfg.enable {
# create the stallwart user # create the stallwart user

View file

@ -3,18 +3,23 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.services.usbguard; cfg = config.modules.services.usbguard;
in { in
{
options.modules.services.usbguard.enable = mkEnableOption "usbguard"; options.modules.services.usbguard.enable = mkEnableOption "usbguard";
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.usbguard ]; environment.systemPackages = [ pkgs.usbguard ];
services.usbguard = { services.usbguard = {
enable = true; enable = true;
IPCAllowedUsers = ["root" "${username}"]; IPCAllowedUsers = [
"root"
"${username}"
];
presentDevicePolicy = "allow"; presentDevicePolicy = "allow";
rules = '' rules = ''
allow with-interface equals { 08:*:* } allow with-interface equals { 08:*:* }

View file

@ -3,11 +3,13 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.modules.services.uwsm; cfg = config.modules.services.uwsm;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in
{
options.modules.services.uwsm.enable = mkEnableOption "uwsm"; options.modules.services.uwsm.enable = mkEnableOption "uwsm";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.uwsm = { programs.uwsm = {

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
custom-wayneko = pkgs.wayneko.overrideAttrs { custom-wayneko = pkgs.wayneko.overrideAttrs {
@ -16,7 +17,8 @@
hash = ""; hash = "";
}; };
in { in
{
systemd.user.services.wayneko = { systemd.user.services.wayneko = {
description = "Wayneko, as a systemd service"; description = "Wayneko, as a systemd service";

View file

@ -9,10 +9,24 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.options) mkOption literalExpression; inherit (lib.options) mkOption literalExpression;
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString; inherit (lib.strings)
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo; toLower
replaceStrings
removePrefix
hasPrefix
isString
;
inherit (lib.types)
str
nullOr
enum
mkOptionType
attrsOf
coercedTo
;
cfg = config.modules.style; cfg = config.modules.style;
@ -25,15 +39,23 @@
colorType = attrsOf (coercedTo str (removePrefix "#") hexColorType); colorType = attrsOf (coercedTo str (removePrefix "#") hexColorType);
nameToSlug = name: toLower (replaceStrings [ " " ] [ "-" ] name); nameToSlug = name: toLower (replaceStrings [ " " ] [ "-" ] name);
getPaletteFromScheme = slug: getPaletteFromScheme =
if builtins.pathExists ./palettes/${slug}.nix slug:
then (import ./palettes/${slug}.nix).colorscheme.palette if builtins.pathExists ./palettes/${slug}.nix then
else throw "The following colorscheme was imported but not found: ${slug}"; (import ./palettes/${slug}.nix).colorscheme.palette
in { else
throw "The following colorscheme was imported but not found: ${slug}";
in
{
options.modules.style = { options.modules.style = {
colorScheme = { colorScheme = {
name = mkOption { name = mkOption {
type = nullOr (enum ["Catppuccin Mocha" "Zenburn" "Black Metal Venom" "Gruvbox"]); type = nullOr (enum [
"Catppuccin Mocha"
"Zenburn"
"Black Metal Venom"
"Gruvbox"
]);
description = "The colorscheme that should be used globally to theme your system."; description = "The colorscheme that should be used globally to theme your system.";
default = "Catppuccin Mocha"; default = "Catppuccin Mocha";
}; };
@ -83,11 +105,11 @@ in {
}; };
variant = mkOption { variant = mkOption {
type = enum ["dark" "light"]; type = enum [
default = "dark"
if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5" "light"
then "dark" ];
else "light"; default = if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5" then "dark" else "light";
description = '' description = ''
Whether the scheme is dark or light Whether the scheme is dark or light
''; '';

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let { pkgs, ... }:
let
inherit (builtins) mapAttrs; inherit (builtins) mapAttrs;
fancy-iosevka = pkgs.iosevka.override { fancy-iosevka = pkgs.iosevka.override {
@ -40,7 +41,8 @@
}; };
set = "Fancy"; set = "Fancy";
}; };
in { in
{
# A (somewhat) sane list of fonts to be installed. # A (somewhat) sane list of fonts to be installed.
fonts = { fonts = {
fontconfig = { fontconfig = {
@ -58,7 +60,8 @@ in {
# Set the defalt fonts. This was taken from raf, # Set the defalt fonts. This was taken from raf,
# many thanks. # many thanks.
defaultFonts = let defaultFonts =
let
common = [ common = [
"Iosevka Nerd Font" "Iosevka Nerd Font"
"Roboto Mono Nerd Font" "Roboto Mono Nerd Font"
@ -76,8 +79,7 @@ in {
}; };
}; };
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
material-icons material-icons
material-design-icons material-design-icons
lexend lexend
@ -88,8 +90,7 @@ in {
corefonts corefonts
font-awesome font-awesome
; ;
inherit inherit (pkgs.nerd-fonts)
(pkgs.nerd-fonts)
iosevka iosevka
jetbrains-mono jetbrains-mono
comic-shanns-mono comic-shanns-mono

View file

@ -1,6 +1,7 @@
# blatantly stolen from sioodmy, thanks :3 # blatantly stolen from sioodmy, thanks :3
{ colors }: { colors }:
with colors; '' with colors;
''
@define-color accent_color #${base0D}; @define-color accent_color #${base0D};
@define-color accent_bg_color #${base0D}; @define-color accent_bg_color #${base0D};
@define-color accent_fg_color #${base00}; @define-color accent_fg_color #${base00};

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (builtins) toString isBool; inherit (builtins) toString isBool;
inherit (lib.generators) toINI; inherit (lib.generators) toINI;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
@ -15,12 +16,12 @@
cfg = config.modules.theming.gtk; cfg = config.modules.theming.gtk;
toGtk3Ini = toINI { toGtk3Ini = toINI {
mkKeyValue = key: value: let mkKeyValue =
value' = key: value:
if isBool value let
then boolToString value value' = if isBool value then boolToString value else toString value;
else toString value; in
in "${escape ["="] key}=${value'}"; "${escape [ "=" ] key}=${value'}";
}; };
gtkIni = { gtkIni = {
@ -34,7 +35,8 @@
gtk-cursor-theme-name = "BreezeX-RosePine-Linux"; gtk-cursor-theme-name = "BreezeX-RosePine-Linux";
gtk-theme-name = "Gruvbox-Dark"; gtk-theme-name = "Gruvbox-Dark";
}; };
in { in
{
options.modules.theming.gtk = { options.modules.theming.gtk = {
enable = mkEnableOption "Wether to enable GTK theming"; enable = mkEnableOption "Wether to enable GTK theming";
theme = { theme = {
@ -63,15 +65,15 @@ in {
}; };
}; };
}; };
config = let config =
let
cursorSize = 32; cursorSize = 32;
in in
mkIf cfg.enable { mkIf cfg.enable {
programs.dconf.enable = true; programs.dconf.enable = true;
environment = { environment = {
systemPackages = builtins.attrValues { systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
rose-pine-cursor rose-pine-cursor
gruvbox-gtk-theme gruvbox-gtk-theme
papirus-icon-theme papirus-icon-theme
@ -83,9 +85,11 @@ in {
XCURSOR_THEME = "BreezeX-RosePine-Linux"; XCURSOR_THEME = "BreezeX-RosePine-Linux";
XCURSOR_SIZE = cursorSize; XCURSOR_SIZE = cursorSize;
}; };
etc = let etc =
let
css = import ./gtk-colors.nix { inherit (config.modules.style.colorScheme) colors; }; css = import ./gtk-colors.nix { inherit (config.modules.style.colorScheme) colors; };
in { in
{
"xdg/gtk-4.0/settings.ini".text = toGtk3Ini { "xdg/gtk-4.0/settings.ini".text = toGtk3Ini {
Settings = gtkIni; Settings = gtkIni;
}; };

View file

@ -3,13 +3,15 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) str package; inherit (lib.types) str package;
cfg = config.modules.theming.qt; cfg = config.modules.theming.qt;
in { in
{
options.modules.theming.qt = { options.modules.theming.qt = {
enable = mkEnableOption "qt theming"; enable = mkEnableOption "qt theming";
name = mkOption { name = mkOption {

View file

@ -4,12 +4,14 @@
pkgs, pkgs,
sources, sources,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.theming.quickshell; cfg = config.modules.theming.quickshell;
in { in
{
options.modules.theming.quickshell.enable = mkEnableOption "quickshell"; options.modules.theming.quickshell.enable = mkEnableOption "quickshell";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1 +1 @@
/run/user/1000/quickshell/vfs/97b86fe3cbb42714790f5e96b44b706b/.qmlls.ini /run/user/1000/quickshell/vfs/4f7a8066a49ba487f5b2754750896151/.qmlls.ini

View file

@ -3,13 +3,15 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkForce mkDefault; inherit (lib.modules) mkForce mkDefault;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int; inherit (lib.types) int;
cfg = config.modules.system.boot; cfg = config.modules.system.boot;
in { in
{
options.modules.system.boot = { options.modules.system.boot = {
grub.enable = mkEnableOption "Grub, a bloated boot loader"; grub.enable = mkEnableOption "Grub, a bloated boot loader";
systemd-boot.enable = mkEnableOption "Poetteringboot"; systemd-boot.enable = mkEnableOption "Poetteringboot";
@ -29,7 +31,8 @@ in {
message = "No bootloader is enabled."; message = "No bootloader is enabled.";
} }
{ {
assertion = cfg.systemd-boot.enable -> !cfg.grub.enable && cfg.grub.enable -> !cfg.systemd-boot.enable; assertion =
cfg.systemd-boot.enable -> !cfg.grub.enable && cfg.grub.enable -> !cfg.systemd-boot.enable;
message = "Please enable only ONE of systemd-boot or grub."; message = "Please enable only ONE of systemd-boot or grub.";
} }
]; ];
@ -73,8 +76,7 @@ in {
plymouth = { plymouth = {
enable = true; enable = true;
themePackages = [ themePackages = [
(pkgs.adi1090x-plymouth-themes.override (pkgs.adi1090x-plymouth-themes.override {
{
selected_themes = [ selected_themes = [
"hud_3" "hud_3"
]; ];

View file

@ -4,12 +4,14 @@
pkgs, pkgs,
sources, sources,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.boot.lanzaboote; cfg = config.modules.system.boot.lanzaboote;
in { in
{
options.modules.system.boot.lanzaboote.enable = mkEnableOption "Lanzaboote"; options.modules.system.boot.lanzaboote.enable = mkEnableOption "Lanzaboote";
imports = [ imports = [
(sources.lanzaboote + "/nix/modules/lanzaboote.nix") (sources.lanzaboote + "/nix/modules/lanzaboote.nix")

View file

@ -3,19 +3,20 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.system.hardware.bluetooth; cfg = config.modules.system.hardware.bluetooth;
in { in
{
config = mkIf cfg.enable { config = mkIf cfg.enable {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
inherit (cfg) powerOnBoot; inherit (cfg) powerOnBoot;
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
bluetuith bluetuith
bluez bluez
blueman blueman

View file

@ -2,12 +2,14 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.hardware; cfg = config.modules.system.hardware;
in { in
{
options.modules.system.hardware = { options.modules.system.hardware = {
nvidia = { nvidia = {
enable = mkEnableOption "Nvidia graphics drivers"; enable = mkEnableOption "Nvidia graphics drivers";

View file

@ -3,19 +3,20 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkDefault mkIf; inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.hardware.intel; cfg = config.modules.system.hardware.intel;
in { in
{
options.modules.system.hardware.intel.enable = mkEnableOption "Intel Hardware"; options.modules.system.hardware.intel.enable = mkEnableOption "Intel Hardware";
config = mkIf cfg.enable { config = mkIf cfg.enable {
hardware = { hardware = {
cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware;
graphics.extraPackages = builtins.attrValues { graphics.extraPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
intel-vaapi-driver intel-vaapi-driver
intel-media-driver intel-media-driver
; ;

View file

@ -2,11 +2,13 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.system.sound; cfg = config.modules.system.sound;
in { in
{
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.pipewire = { services.pipewire = {
enable = true; enable = true;

View file

@ -4,16 +4,17 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkDefault; inherit (lib.modules) mkDefault;
in { in
{
imports = [ imports = [
# (sources.watt + "/nix/module.nix") # (sources.watt + "/nix/module.nix")
]; ];
config = { config = {
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
acpi acpi
powertop powertop
; ;

View file

@ -4,9 +4,12 @@
pkgs, pkgs,
sources, sources,
... ...
}: let }:
let
determinate = (import sources.flake-compat { src = sources.determinate; }).outputs; determinate = (import sources.flake-compat { src = sources.determinate; }).outputs;
dix = (import sources.flake-compat {src = determinate.inputs.nix;}).outputs.packages.${pkgs.stdenv.system}.nix; dix =
(import sources.flake-compat { src = determinate.inputs.nix; })
.outputs.packages.${pkgs.stdenv.system}.nix;
# Stronger than mkDefault (1000), weaker than mkForce (50) and the "default override priority" # Stronger than mkDefault (1000), weaker than mkForce (50) and the "default override priority"
# (100). # (100).
@ -14,7 +17,8 @@
# Stronger than the "default override priority", as the upstream module uses that, and weaker than mkForce (50). # Stronger than the "default override priority", as the upstream module uses that, and weaker than mkForce (50).
mkMorePreferable = lib.mkOverride 75; mkMorePreferable = lib.mkOverride 75;
in { in
{
config = { config = {
nix = { nix = {
package = dix; package = dix;
@ -30,7 +34,9 @@ in {
services.nix-daemon.serviceConfig = { services.nix-daemon.serviceConfig = {
ExecStart = [ ExecStart = [
"" ""
"@${determinate.packages.${pkgs.stdenv.system}.default}/bin/determinate-nixd determinate-nixd --nix-bin ${config.nix.package}/bin daemon" "@${
determinate.packages.${pkgs.stdenv.system}.default
}/bin/determinate-nixd determinate-nixd --nix-bin ${config.nix.package}/bin daemon"
]; ];
KillMode = mkPreferable "process"; KillMode = mkPreferable "process";
LimitNOFILE = mkMorePreferable 1048576; LimitNOFILE = mkMorePreferable 1048576;
@ -45,7 +51,10 @@ in {
before = [ "multi-user.target" ]; before = [ "multi-user.target" ];
unitConfig = { unitConfig = {
RequiresMountsFor = ["/nix/store" "/nix/var/determinate"]; RequiresMountsFor = [
"/nix/store"
"/nix/var/determinate"
];
}; };
socketConfig = { socketConfig = {

View file

@ -5,10 +5,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in
{
nix = { nix = {
# Check that Nix can parse the generated nix.conf. # Check that Nix can parse the generated nix.conf.
checkConfig = true; checkConfig = true;
@ -62,10 +64,18 @@ in {
auto-optimise-store = true; auto-optimise-store = true;
# Users that are allowed to connect to the Nix daemon. # Users that are allowed to connect to the Nix daemon.
allowed-users = ["root" "@wheel" "nix-builder"]; allowed-users = [
"root"
"@wheel"
"nix-builder"
];
# Users that are allowed to connect to the Nix daemon. # Users that are allowed to connect to the Nix daemon.
trusted-users = ["root" "@wheel" "nix-builder"]; trusted-users = [
"root"
"@wheel"
"nix-builder"
];
# Let the system decide the number of max jobs # Let the system decide the number of max jobs
# based on available system specs. Usually this is # based on available system specs. Usually this is

View file

@ -1,5 +1,6 @@
# taken from raf # taken from raf
{sources, ...}: { { sources, ... }:
{
# Global nixpkgs configuration. # Global nixpkgs configuration.
# This is ignored if nixpkgs.pkgs is set, which should be avoided. # This is ignored if nixpkgs.pkgs is set, which should be avoided.
nixpkgs = { nixpkgs = {

View file

@ -4,12 +4,14 @@
lib, lib,
sources, sources,
... ...
}: let }:
let
inherit (lib.modules) mkIf mkForce; inherit (lib.modules) mkIf mkForce;
inherit (builtins) map; inherit (builtins) map;
cfg = config.modules.system.impermanence; cfg = config.modules.system.impermanence;
in { in
{
imports = [ imports = [
(sources.impermanence + "/nixos.nix") (sources.impermanence + "/nixos.nix")
]; ];
@ -41,20 +43,36 @@ in {
]; ];
users.cr = { users.cr = {
directories = directories = [
[
"cloud" "cloud"
"repos" "repos"
] ]
++ map ( ++ map (dir: ".config/${dir}") [
dir: ".config/${dir}" "nicotine"
) ["nicotine" "Signal" "Nextcloud" "emacs" "doom"] "Signal"
++ map ( "Nextcloud"
dir: ".cache/${dir}" "emacs"
) ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "zsh" "nvim"] "doom"
++ map ( ]
dir: ".local/share/${dir}" ++ map (dir: ".cache/${dir}") [
) ["direnv" "Steam" "TelegramDesktop" "PrismLauncher" "nicotine" "zoxide" ".keepass"]; "tealdeer"
"keepassxc"
"nix"
"starship"
"nix-index"
"mozilla"
"zsh"
"nvim"
]
++ map (dir: ".local/share/${dir}") [
"direnv"
"Steam"
"TelegramDesktop"
"PrismLauncher"
"nicotine"
"zoxide"
".keepass"
];
}; };
}; };

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
StateDirectory = "dnscrypt-proxy"; StateDirectory = "dnscrypt-proxy";
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in
{
networking = { networking = {
networkmanager.dns = mkForce "none"; networkmanager.dns = mkForce "none";
nameservers = [ nameservers = [

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
networking = { networking = {
# use nftables over iptables # use nftables over iptables
nftables.enable = true; nftables.enable = true;

View file

@ -1,6 +1,8 @@
{config, ...}: let { config, ... }:
let
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
in { in
{
networking = { networking = {
enableIPv6 = true; enableIPv6 = true;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
security = { security = {
# Enable Soteria, a GTK-based Polkit authentication agent. # Enable Soteria, a GTK-based Polkit authentication agent.
soteria.enable = true; soteria.enable = true;

View file

@ -2,9 +2,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkForce mkDefault; inherit (lib.modules) mkForce mkDefault;
in { in
{
security = { security = {
sudo-rs.enable = mkForce false; sudo-rs.enable = mkForce false;
sudo = { sudo = {

View file

@ -1,6 +1,8 @@
{lib, ...}: let { lib, ... }:
let
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
in { in
{
config.systemd = { config.systemd = {
# faster startup # faster startup
targets.network-online.wantedBy = mkForce [ ]; # Normally ["multi-user.target"] targets.network-online.wantedBy = mkForce [ ]; # Normally ["multi-user.target"]

View file

@ -1,6 +1,8 @@
{config, ...}: let { config, ... }:
let
machine-id = builtins.substring 0 32 (builtins.hashString "sha256" config.networking.hostName); machine-id = builtins.substring 0 32 (builtins.hashString "sha256" config.networking.hostName);
in { in
{
system = { system = {
# My state version. # My state version.
stateVersion = "23.11"; stateVersion = "23.11";

View file

@ -3,7 +3,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkForce mkIf; inherit (lib.modules) mkForce mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (config.modules.system) isGraphical; inherit (config.modules.system) isGraphical;
@ -27,13 +28,11 @@
}) })
]; ];
}); });
in { in
{
options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor"; options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor";
config = config = mkIf (cfg.enable || isGraphical) {
mkIf (cfg.enable
|| isGraphical)
{
programs.niri = { programs.niri = {
enable = true; enable = true;
package = patched-niri; package = patched-niri;
@ -45,8 +44,7 @@ in {
environment.etc."niri/config.kdl".source = ./config.kdl; environment.etc."niri/config.kdl".source = ./config.kdl;
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
xwayland-satellite xwayland-satellite
avizo avizo
playerctl playerctl

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.lists) optional; inherit (lib.lists) optional;
in { in
{
xdg.portal = { xdg.portal = {
enable = true; enable = true;
# Sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1. # Sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1.

View file

@ -2,12 +2,14 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.wms.wayland; cfg = config.modules.wms.wayland;
in { in
{
options.modules.wms.wayland.enable = mkEnableOption "wayland"; options.modules.wms.wayland.enable = mkEnableOption "wayland";
config = mkIf true { config = mkIf true {
environment.variables = { environment.variables = {

View file

@ -2,12 +2,19 @@
inputs, inputs,
pkgs, pkgs,
sources, sources,
}: let }:
let
inherit (pkgs) lib; inherit (pkgs) lib;
helix = pkgs.callPackage ./helix { }; helix = pkgs.callPackage ./helix { };
kakoune = pkgs.callPackage ./kakoune.nix { }; kakoune = pkgs.callPackage ./kakoune.nix { };
fish = pkgs.callPackage ./fish { inherit lib; }; fish = pkgs.callPackage ./fish { inherit lib; };
nushell = pkgs.callPackage ./nushell { }; nushell = pkgs.callPackage ./nushell { };
in { in
inherit kakoune fish helix nushell; {
inherit
kakoune
fish
helix
nushell
;
} }

View file

@ -1,6 +1,8 @@
{pkgs, ...}: let { pkgs, ... }:
let
inherit (pkgs.lib) getExe; inherit (pkgs.lib) getExe;
in { in
{
ls = "${getExe pkgs.eza} --icons=never"; ls = "${getExe pkgs.eza} --icons=never";
la = "${getExe pkgs.eza} --icons=never -lha --git"; la = "${getExe pkgs.eza} --icons=never -lha --git";

View file

@ -1,7 +1,8 @@
# This shell setup was originally inspired by sioodmy. # This shell setup was originally inspired by sioodmy.
# Some further cool tricks, like using vendor_conf.d to avoid having # Some further cool tricks, like using vendor_conf.d to avoid having
# to build fish myself, are taken from viperml's setup. # to build fish myself, are taken from viperml's setup.
{pkgs, ...}: let { pkgs, ... }:
let
inherit (pkgs) lib; inherit (pkgs) lib;
inherit (lib.strings) concatStringsSep; inherit (lib.strings) concatStringsSep;
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
@ -19,9 +20,7 @@
; ;
}; };
aliasesStr = aliasesStr = mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases |> concatStringsSep "\n";
mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases
|> concatStringsSep "\n";
packages = import ./packages.nix pkgs; packages = import ./packages.nix pkgs;
in in
@ -38,8 +37,8 @@ in
] ]
}" }"
''; '';
}) }).overrideAttrs
.overrideAttrs (_: { (_: {
passthru = { passthru = {
shellPath = "/bin/fish"; shellPath = "/bin/fish";
}; };

View file

@ -1,7 +1,6 @@
pkgs: pkgs:
builtins.attrValues { builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
# better cd # better cd
zoxide zoxide
# pipe viewer # pipe viewer

View file

@ -14,44 +14,110 @@
docker_context.symbol = " "; docker_context.symbol = " ";
elixir.symbol = " "; elixir.symbol = " ";
elm.symbol = " "; elm.symbol = " ";
fennel = {symbol = " ";}; fennel = {
fossil_branch = {symbol = " ";}; symbol = " ";
gcloud = {symbol = " ";}; };
git_branch = {symbol = " ";}; fossil_branch = {
git_commit = {tag_symbol = " ";}; symbol = " ";
};
gcloud = {
symbol = " ";
};
git_branch = {
symbol = " ";
};
git_commit = {
tag_symbol = " ";
};
golang.symbol = " "; golang.symbol = " ";
gradle = {symbol = " ";}; gradle = {
guix_shell = {symbol = " ";}; symbol = " ";
haskell = {symbol = " ";}; };
haxe = {symbol = " ";}; guix_shell = {
hg_branch = {symbol = " ";}; symbol = " ";
hostname = {ssh_symbol = " ";}; };
java = {symbol = " ";}; haskell = {
julia = {symbol = " ";}; symbol = " ";
kotlin = {symbol = " ";}; };
lua = {symbol = " ";}; haxe = {
memory_usage = {symbol = "󰍛 ";}; symbol = " ";
meson = {symbol = "󰔷 ";}; };
nim = {symbol = "󰆥 ";}; hg_branch = {
nix_shell = {symbol = " ";}; symbol = " ";
nodejs = {symbol = " ";}; };
ocaml = {symbol = " ";}; hostname = {
ssh_symbol = " ";
};
java = {
symbol = " ";
};
julia = {
symbol = " ";
};
kotlin = {
symbol = " ";
};
lua = {
symbol = " ";
};
memory_usage = {
symbol = "󰍛 ";
};
meson = {
symbol = "󰔷 ";
};
nim = {
symbol = "󰆥 ";
};
nix_shell = {
symbol = " ";
};
nodejs = {
symbol = " ";
};
ocaml = {
symbol = " ";
};
os = { os = {
symbols = { symbols = {
Linux = " "; Linux = " ";
NixOS = " "; NixOS = " ";
}; };
}; };
package = {symbol = "󰏗 ";}; package = {
perl = {symbol = " ";}; symbol = "󰏗 ";
php = {symbol = " ";}; };
pijul_channel = {symbol = " ";}; perl = {
pixi = {symbol = "󰏗 ";}; symbol = " ";
python = {symbol = " ";}; };
rlang = {symbol = "󰟔 ";}; php = {
ruby = {symbol = " ";}; symbol = " ";
rust = {symbol = "󱘗 ";}; };
scala = {symbol = " ";}; pijul_channel = {
swift = {symbol = " ";}; symbol = " ";
zig = {symbol = " ";}; };
pixi = {
symbol = "󰏗 ";
};
python = {
symbol = " ";
};
rlang = {
symbol = "󰟔 ";
};
ruby = {
symbol = " ";
};
rust = {
symbol = "󱘗 ";
};
scala = {
symbol = " ";
};
swift = {
symbol = " ";
};
zig = {
symbol = " ";
};
} }

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