Added boot.nix

This commit is contained in:
2026-03-06 23:23:15 +01:00
parent c48289d432
commit f341ab27c6
5 changed files with 583 additions and 457 deletions
+397 -338
View File
File diff suppressed because it is too large Load Diff
+104 -52
View File
@@ -341,61 +341,66 @@ This section contains the Org blocks for tangling Nix code into the generated fo
** =flake.nix= ** =flake.nix=
The Nix flake definition for Droidnix. The Nix flake definition for Droidnix.
#+BEGIN_SRC nix :tangle flake.nix :noweb tangle :mkdirp yes :eval never-html #+BEGIN_SRC nix :tangle flake.nix :noweb tangle :mkdirp yes :eval never-html
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
};
outputs =
inputs@{
nixpkgs,
home-manager,
emacs-overlay,
catppuccin,
zen-browser,
hyprland,
...
}:
let
lib = nixpkgs.lib;
system = "x86_64-linux"; # Define the system explicitly
user = import ./assets/flake/users/henrov.nix;
machines = [
"traveldroid"
"maindroid"
];
in
{ {
description = "Droidnix: A dendritic NixOS + Home Manager configuration"; nixosConfigurations = lib.genAttrs machines (
machine:
lib.nixosSystem {
inherit system;
modules = [
# Import machine-specific configurations
./assets/flake/machines/${machine}/top.nix
inputs = { # Home Manager and theme modules
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager.nixosModules.home-manager
home-manager = { {
url = "github:nix-community/home-manager"; home-manager.useGlobalPkgs = true;
inputs.nixpkgs.follows = "nixpkgs"; home-manager.useUserPackages = true;
}; home-manager.extraSpecialArgs = { inherit user inputs; };
emacs-overlay = { }
url = "github:nix-community/emacs-overlay"; inputs.catppuccin.nixosModules.catppuccin
inputs.nixpkgs.follows = "nixpkgs"; ];
}; specialArgs = { inherit user inputs; };
catppuccin = { }
url = "github:catppuccin/nix"; );
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
};
outputs = inputs@{ nixpkgs, home-manager, emacs-overlay, catppuccin, zen-browser, hyprland, ... }: devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
let inherit (nixpkgs) mkShell;
lib = nixpkgs.lib;
system = lib.system.system;
user = import ./assets/flake/users/henrov.nix;
machines = ["traveldroid" "maindroid"];
in
{
nixosConfigurations = lib.genAttrs machines (machine: lib.nixosSystem {
inherit system;
modules = [
# Import machine-specific configurations
./assets/flake/machines/${machine}/top.nix
# Home Manager and theme modules
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user inputs; };
}
inputs.catppuccin.nixosModules.catppuccin
];
specialArgs = { inherit user inputs; };
});
devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
inherit (nixpkgs) mkShell;
}; };
}; };
} }
#+END_SRC #+END_SRC
* First the nix-files that flake really needs and that do not fit wel in the hierarchical structure * First the nix-files that flake really needs and that do not fit wel in the hierarchical structure
@@ -426,16 +431,63 @@ mkShell {
** =assets/flake/machines/traveldroid/top.nix= ** =assets/flake/machines/traveldroid/top.nix=
This code defines the machine to build. Just search and replace traveldroid to provision another machine. This code defines the machine to build. Just search and replace traveldroid to provision another machine.
#+BEGIN_SRC nix :tangle assets/flake/machines/traveldroid/top.nix :noweb tangle :mkdirp yes :eval never-html #+BEGIN_SRC nix :tangle assets/flake/machines/traveldroid/top.nix :noweb tangle :mkdirp yes :eval never-html
{ config, pkgs, lib, user, inputs, ... }: {
config,
pkgs,
lib,
user,
inputs,
...
}:
{ {
# Import all other configurations # Import all other configurations
imports = [ imports = [
./boot.nix
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
options = {
wm = lib.mkOption {
type = lib.types.str;
default = "hyprland";
description = "Type of window manager to use";
};
};
config = {
# Minimal settings that must be defined here # Minimal settings that must be defined here
networking.hostName = "traveldroid"; networking.hostName = "traveldroid";
wm.type = "hyprland"; # Define the window manager type here, mangowc will be made possible in the nerar future. wm.type = "hyprland"; # Define the window manager type here, mangowc will be made possible in the near future.
# In generated/top.nix the chpice fopr a window manager will be effectuated };
}
#+END_SRC
** =assets/flake/machines/traveldroid/boot.nix=
This file has most of the settings the control how the computer boots up.
#+BEGIN_SRC nix :tangle assets/flake/machines/traveldroid/boot.nix :noweb tangle :mkdirp yes :eval never-html
:noweb tangle :mkdirp yes
{ pkgs, ... } :
{
boot = {
initrd = {
verbose = false; # its a lot of logs. dont need it, unless we do.
kernelModules = [ ]; # no kernel modules on boot
};
extraModulePackages = [ ]; # no extra packages on boot either
kernelPackages = pkgs.linuxPackages_latest; # latest greatest linux kernel
kernelParams = [ "silent" ]; # quiet those logs
consoleLogLevel = 0; # quiten more logs
plymouth.enable = true; # graphical boot animation instead
supportedFilesystems = [ "ntfs" ]; # should see the ntfs (windows)
loader = {
systemd-boot.enable = true; # systemd-boot
systemd-boot.configurationLimit = 10;
efi.canTouchEfiVariables = true; # allow editing efi to edit the boot loader
timeout = 5; # grub timeout to make a selection
};
};
} }
#+END_SRC #+END_SRC
@@ -0,0 +1,26 @@
:noweb tangle :mkdirp yes
{ pkgs, ... } :
{
boot = {
initrd = {
verbose = false; # its a lot of logs. dont need it, unless we do.
kernelModules = [ ]; # no kernel modules on boot
};
extraModulePackages = [ ]; # no extra packages on boot either
kernelPackages = pkgs.linuxPackages_latest; # latest greatest linux kernel
kernelParams = [ "silent" ]; # quiet those logs
consoleLogLevel = 0; # quiten more logs
plymouth.enable = true; # graphical boot animation instead
supportedFilesystems = [ "ntfs" ]; # should see the ntfs (windows)
loader = {
systemd-boot.enable = true; # systemd-boot
systemd-boot.configurationLimit = 10;
efi.canTouchEfiVariables = true; # allow editing efi to edit the boot loader
timeout = 5; # grub timeout to make a selection
};
};
}
@@ -9,9 +9,9 @@
{ {
# Import all other configurations # Import all other configurations
imports = [ imports = [
./boot.nix
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
options = { options = {
wm = lib.mkOption { wm = lib.mkOption {
type = lib.types.str; type = lib.types.str;
@@ -19,7 +19,6 @@
description = "Type of window manager to use"; description = "Type of window manager to use";
}; };
}; };
config = { config = {
# Minimal settings that must be defined here # Minimal settings that must be defined here
networking.hostName = "traveldroid"; networking.hostName = "traveldroid";
+55 -65
View File
@@ -1,70 +1,60 @@
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
};
outputs =
inputs@{
nixpkgs,
home-manager,
emacs-overlay,
catppuccin,
zen-browser,
hyprland,
...
}:
let
lib = nixpkgs.lib;
system = "x86_64-linux"; # Define the system explicitly
user = import ./assets/flake/users/henrov.nix;
machines = [
"traveldroid"
"maindroid"
];
in
{ {
description = "Droidnix: A dendritic NixOS + Home Manager configuration"; nixosConfigurations = lib.genAttrs machines (
machine:
lib.nixosSystem {
inherit system;
modules = [
# Import machine-specific configurations
./assets/flake/machines/${machine}/top.nix
inputs = { # Home Manager and theme modules
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager.nixosModules.home-manager
home-manager = { {
url = "github:nix-community/home-manager"; home-manager.useGlobalPkgs = true;
inputs.nixpkgs.follows = "nixpkgs"; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user inputs; };
}
inputs.catppuccin.nixosModules.catppuccin
];
specialArgs = { inherit user inputs; };
}
);
devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
inherit (nixpkgs) mkShell;
}; };
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
}; };
outputs =
inputs@{
nixpkgs,
home-manager,
emacs-overlay,
catppuccin,
zen-browser,
hyprland,
...
}:
let
lib = nixpkgs.lib;
system = "x86_64-linux"; # Define the system explicitly
user = import ./assets/flake/users/henrov.nix;
machines = [
"traveldroid"
"maindroid"
];
in
{
nixosConfigurations = lib.genAttrs machines (
machine:
lib.nixosSystem {
inherit system;
modules = [
# Import machine-specific configurations
./assets/flake/machines/${machine}/top.nix
# Home Manager and theme modules
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user inputs; };
}
inputs.catppuccin.nixosModules.catppuccin
];
specialArgs = { inherit user inputs; };
}
);
devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
inherit (nixpkgs) mkShell;
};
};
} }