Working on reshuffling
This commit is contained in:
+107
-108
@@ -101,45 +101,24 @@ The Nix flake definition for Droidnix.
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{
|
||||
flake-parts,
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
emacs-overlay,
|
||||
zen-browser,
|
||||
hyprland,
|
||||
stylix,
|
||||
import-tree,
|
||||
...
|
||||
}:
|
||||
outputs = inputs@{ flake-parts, nixpkgs, home-manager, stylix, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
|
||||
# Declare supported systems for flake-parts
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
# Import dendritic/flake modules here
|
||||
imports = [
|
||||
(import-tree ./generated/modules) # Only mySystem.* stuff
|
||||
];
|
||||
|
||||
# Define NixOS configurations for hosts
|
||||
flake = {
|
||||
nixosConfigurations.traveldroid =
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
nixosConfigurations.traveldroid = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
modules = [
|
||||
# Host-specific configuration (NixOS context)
|
||||
./generated/hosts/traveldroid/traveldroid.nix
|
||||
modules = [
|
||||
# Host module imports all reusable modules internally
|
||||
./generated/hosts/traveldroid/traveldroid.nix
|
||||
|
||||
# Boot configuration (NixOS context)
|
||||
./generated/hosts/traveldroid/boot.nix
|
||||
|
||||
# Stylix NixOS module
|
||||
stylix.nixosModules.default
|
||||
];
|
||||
};
|
||||
# Optional host-specific things
|
||||
./generated/hosts/traveldroid/boot.nix
|
||||
./generated/hosts/traveldroid/hardware-configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -386,97 +365,117 @@ in
|
||||
** =generated/hosts/traveldroid/boot.nix=
|
||||
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/boot.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
# ./generated/hosts/traveldroid/traveldroid.nix
|
||||
{ config, pkgs, lib, ... }:
|
||||
# ./generated/hosts/traveldroid/traveldroid.nix
|
||||
{ inputs, ... }:
|
||||
|
||||
let
|
||||
coreEnabled = config.mySystem.system.core.enable or false;
|
||||
in lib.mkIf coreEnabled {
|
||||
boot = {
|
||||
initrd = {
|
||||
verbose = false;
|
||||
kernelModules = [ ];
|
||||
# Import all reusable modules under ./generated/modules
|
||||
modulesDir = ../../modules; # adjust path relative to this host file
|
||||
importedModules = builtins.attrValues (import modulesDir { inherit inputs; });
|
||||
in
|
||||
{
|
||||
# Define the NixOS configuration for this host
|
||||
flake.nixosConfigurations.traveldroid =
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.stylix.nixosModules.stylix
|
||||
] ++ importedModules ++ [
|
||||
./hardware-configuration.nix
|
||||
|
||||
# Host-specific settings
|
||||
({ config, ... }: {
|
||||
networking.hostName = "traveldroid";
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
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"
|
||||
];
|
||||
|
||||
# Optional: TPM/other features
|
||||
# systemd.tpm2.enable = false;
|
||||
|
||||
# User-defined modules / system features
|
||||
mySystem = {
|
||||
system.core.enable = true;
|
||||
|
||||
# Hardware toggles
|
||||
hardware.nvidia.enable = false;
|
||||
|
||||
# Desktop environment modules
|
||||
desktop = {
|
||||
hyprland.enable = true;
|
||||
noctalia.enable = true;
|
||||
stylix.enable = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
extraModulePackages = [ ];
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelParams = [ "silent" ];
|
||||
|
||||
consoleLogLevel = 0;
|
||||
plymouth.enable = true;
|
||||
supportedFilesystems = [ "ntfs" ];
|
||||
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.configurationLimit = 10;
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 5;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+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
|
||||
{ inputs, config, ... }:
|
||||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
flake.nixosConfigurations."traveldroid" = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
modules =
|
||||
[
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.stylix.nixosModules.stylix
|
||||
] ++
|
||||
(builtins.attrValues config.flake.nixosModules) ++
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
# Optional: pass inputs to modules
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
({ ... }: {
|
||||
networking.hostName = "traveldroid";
|
||||
system.stateVersion = "25.11";
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
]
|
||||
++ builtins.attrValues (import-tree ./generated/modules)
|
||||
++ [
|
||||
./hardware-configuration.nix
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
useOSProber = true;
|
||||
};
|
||||
# Host-specific hardware and system settings
|
||||
({ config, lib, ... }: {
|
||||
networking.hostName = "traveldroid";
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
useOSProber = true;
|
||||
};
|
||||
boot.efi.canTouchEfiVariables = true;
|
||||
|
||||
# initrd.systemd.tpm2.enable = false;
|
||||
kernelParams = [
|
||||
"systemd.mask=dev-tpm0.device"
|
||||
"systemd.mask=dev-tpmrm0.device"
|
||||
];
|
||||
};
|
||||
|
||||
# systemd.tpm2.enable = false;
|
||||
|
||||
# Enable various user-defined modules
|
||||
mySystem = {
|
||||
# Turn on the core system
|
||||
system.core.enable = true;
|
||||
|
||||
# Hardware-specific modules
|
||||
hardware.nvidia.enable = false;
|
||||
|
||||
# Define Environment
|
||||
desktop = {
|
||||
hyprland.enable = true;
|
||||
noctalia.enable = true;
|
||||
stylix.enable = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
boot.kernelParams = [
|
||||
"systemd.mask=dev-tpm0.device"
|
||||
"systemd.mask=dev-tpmrm0.device"
|
||||
];
|
||||
};
|
||||
|
||||
# User-defined features
|
||||
mySystem.system.core.enable = true;
|
||||
|
||||
# Desktop environment features
|
||||
desktop.hyprland.enable = true;
|
||||
desktop.noctalia.enable = true;
|
||||
desktop.stylix.enable = true;
|
||||
|
||||
# Hardware overrides (host-specific)
|
||||
hardware.nvidia.enable = false;
|
||||
})
|
||||
];
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
||||
Reference in New Issue
Block a user