Regenerated

This commit is contained in:
2026-03-22 06:39:11 +00:00
parent fe973acc15
commit 60c5a13d01
58 changed files with 1080 additions and 1662 deletions
+150 -152
View File
@@ -59,6 +59,50 @@ The =generated/= directory contains all generated configurations, divided into t
The =.assets/= folder contains all static files, such as configs, scripts, and themes. These files are not generated and can be edited directly.
* Templates look like this :code:
** =generated/template.nix=
#+BEGIN_SRC nix :tangle generated/template.nix :noweb tangle :mkdirp yes :eval never-html
{ lib, config, pkgs, inputs, ... }:
let
# Default username fallback
username = config.defaultUser or "henrov";
# Asset folder for configs
assetPath = ../../../assets/<myModuleName>/conf;
# Main configuration file
mainConfig = "${assetPath}/<mainConfigFile>";
# Determine the package: prefer Nixpkgs, fallback to -git, fallback to flake input
myPkg =
pkgs.<myPackage> or
pkgs.<myPackage>-git or
inputs.<myPackage>.packages.${pkgs.system}.default;
in
{
# Install system-wide
environment.systemPackages = [ myPkg ];
# Home Manager user settings
_module.args.hmUsers = {
${username} = {
home.packages = [ myPkg ];
# Copy main config into user's home
home.file.".config/<myModuleName>/<mainConfigFile>".source = mainConfig;
# Optional module-specific settings
settings.general = {
# Example placeholder
"example.setting" = "value";
};
# Optional: you can add more files dynamically from assetPath if needed
};
};
}
#+END_SRC
* The Actual Code :code:
:PROPERTIES:
@@ -66,7 +110,6 @@ The =.assets/= folder contains all static files, such as configs, scripts, and t
:END:
This section contains the Org blocks for tangling Nix code into the generated folders.
** =flake.nix=
The Nix flake definition for Droidnix.
#+BEGIN_SRC nix :tangle flake.nix :noweb tangle :mkdirp yes :eval never-html
@@ -119,47 +162,123 @@ The Nix flake definition for Droidnix.
}
#+END_SRC
** -generated/template.nix
#+BEGIN_SRC nix :tangle generated/template.nix :noweb tangle :mkdirp yes :eval never-html
** =generated/hosts/traveldroid/traveldroid.nix=
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/traveldroid.nix :noweb tangle :mkdirp yes :eval never-html
{ lib, config, pkgs, inputs, ... }:
let
# Default username fallback
username = config.defaultUser or "henrov";
modulesPath = ./generated/modules;
# Asset folder for configs
assetPath = ../../../assets/<myModuleName>/conf;
# Import all modules recursively
importedModules = inputs.import-tree modulesPath;
# Main configuration file
mainConfig = "${assetPath}/<mainConfigFile>";
# Evaluate all modules
evaluatedModules =
map (m:
if builtins.isFunction m then m { inherit lib config pkgs; } else m
) importedModules.imports;
# Determine the package: prefer Nixpkgs, fallback to -git, fallback to flake input
myPkg =
pkgs.<myPackage> or
pkgs.<myPackage>-git or
inputs.<myPackage>.packages.${pkgs.system}.default;
in
# Attach names
modulesWithNames =
map (m: {
name = if m ? _file then lib.removeSuffix ".nix" (builtins.baseNameOf m._file) else "unknown";
value = m;
}) evaluatedModules;
# Filter enabled modules from config file (optional)
moduleSwitches = import ../../../assets/system/conf/modules.conf;
enabledModules =
builtins.filter (m: moduleSwitches.${m.name} or false) modulesWithNames;
# Collect Home Manager user attrsets
hmUsersList = map (m: m.value._module.args.hmUsers or {}) enabledModules;
in {
networking.hostName = "traveldroid";
system.stateVersion = "26.05";
imports = [
./boot.nix
./hardware-configuration.nix
];
# Merge Home Manager user configurations
home-manager.users = lib.mkMerge hmUsersList;
}
#+END_SRC
** =generated/hosts/traveldroid/hardware-configuration.nix=
1. Boot into NixOS Live ISO or your installed system.
2. Open a terminal.
3. Run: <code>sudo nixos-generate-config --root /mnt</code> (Omit --root /mnt if already running NixOS.)
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/hardware-configuration.nix :noweb tangle :mkdirp yes :eval never-html
{
# Install system-wide
environment.systemPackages = [ myPkg ];
hostname,
pkgs,
lib,
modulesPath,
user,
config,
...
}:
{
imports = [
# (modulesPath + "/installer/scan/not-detected.nix")
#../../hardware/hardware.nix
];
# Home Manager user settings
_module.args.hmUsers = {
${username} = {
home.packages = [ myPkg ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_usb_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# Copy main config into user's home
home.file.".config/<myModuleName>/<mainConfigFile>".source = mainConfig;
# Optional module-specific settings
settings.general = {
# Example placeholder
"example.setting" = "value";
};
# Optional: you can add more files dynamically from assetPath if needed
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/69433a14-fbaf-401b-af85-cd1bbf02b4e2";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/811D-0676";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/b6c557c2-7682-460b-a5e7-8f6f2f429a3a"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
#+END_SRC
** =generated/hosts/traveldroid/boot.nix=
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/boot.nix :noweb tangle :mkdirp yes :eval never-html
{ inputs, config, lib, pkgs, ... }:
{
boot.loader.grub = {
enable = true;
efiSupport = true;
device = "nodev";
useOSProber = true;
};
#boot.efi.canTouchEfiVariables = true;
boot.kernelParams = [
"systemd.mask=dev-tpm0.device"
"systemd.mask=dev-tpmrm0.device"
];
}
#+END_SRC
@@ -335,126 +454,10 @@ in
}
#+END_SRC
** =generated/hosts/traveldroid/boot.nix=
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/boot.nix :noweb tangle :mkdirp yes :eval never-html
{ inputs, config, lib, pkgs, ... }:
{
boot.loader.grub = {
enable = true;
efiSupport = true;
device = "nodev";
useOSProber = true;
};
#boot.efi.canTouchEfiVariables = true;
boot.kernelParams = [
"systemd.mask=dev-tpm0.device"
"systemd.mask=dev-tpmrm0.device"
];
}
#+END_SRC
* First the nix-files that flake really needs and that do not fit wel in the hierarchical structure
** =generated/hosts/traveldroid/traveldroid.nix=
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/traveldroid.nix :noweb tangle :mkdirp yes :eval never-html
{ lib, config, pkgs, inputs, ... }:
let
username = config.defaultUser or "henrov";
modulesPath = ./generated/modules;
# Import all modules recursively
importedModules = inputs.import-tree modulesPath;
# Evaluate all modules
evaluatedModules =
map (m:
if builtins.isFunction m then m { inherit lib config pkgs; } else m
) importedModules.imports;
# Attach names
modulesWithNames =
map (m: {
name = if m ? _file then lib.removeSuffix ".nix" (builtins.baseNameOf m._file) else "unknown";
value = m;
}) evaluatedModules;
# Filter enabled modules from config file (optional)
moduleSwitches = import ../../../assets/system/conf/modules.conf;
enabledModules =
builtins.filter (m: moduleSwitches.${m.name} or false) modulesWithNames;
# Collect Home Manager user attrsets
hmUsersList = map (m: m.value._module.args.hmUsers or {}) enabledModules;
in {
networking.hostName = "traveldroid";
system.stateVersion = "26.05";
imports = [
./boot.nix
./hardware-configuration.nix
];
# Merge Home Manager user configurations
home-manager.users = lib.mkMerge hmUsersList;
}
#+END_SRC
** =generated/hosts/traveldroid/hardware-configuration.nix=
1. Boot into NixOS Live ISO or your installed system.
2. Open a terminal.
3. Run: <code>sudo nixos-generate-config --root /mnt</code> (Omit --root /mnt if already running NixOS.)
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/hardware-configuration.nix :noweb tangle :mkdirp yes :eval never-html
{
hostname,
pkgs,
lib,
modulesPath,
user,
config,
...
}:
{
imports = [
# (modulesPath + "/installer/scan/not-detected.nix")
#../../hardware/hardware.nix
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_usb_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/69433a14-fbaf-401b-af85-cd1bbf02b4e2";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/811D-0676";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/b6c557c2-7682-460b-a5e7-8f6f2f429a3a"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
#+END_SRC
** =generated/parked/system/dbus.nix=
This sets the dbus implementation
@@ -566,9 +569,6 @@ let
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableStylix or false;
# Read the main stylix.conf
stylixConfFile = "${assetPath}/stylix.conf";
stylixConf = if builtins.pathExists stylixConfFile
@@ -581,8 +581,6 @@ let
in
{
# --- Top-level toggle ---
options.enableStylix = lib.mkEnableOption "Enable Stylix system theming";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {