Added boot.nix
This commit is contained in:
+397
-338
File diff suppressed because it is too large
Load Diff
+104
-52
@@ -341,61 +341,66 @@ This section contains the Org blocks for tangling Nix code into the generated fo
|
||||
** =flake.nix=
|
||||
The Nix flake definition for Droidnix.
|
||||
#+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 = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
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";
|
||||
};
|
||||
# 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; };
|
||||
}
|
||||
);
|
||||
|
||||
outputs = inputs@{ nixpkgs, home-manager, emacs-overlay, catppuccin, zen-browser, hyprland, ... }:
|
||||
let
|
||||
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;
|
||||
devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
|
||||
inherit (nixpkgs) mkShell;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#+END_SRC
|
||||
|
||||
* 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=
|
||||
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
|
||||
{ config, pkgs, lib, user, inputs, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
user,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Import all other configurations
|
||||
imports = [
|
||||
./boot.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
|
||||
networking.hostName = "traveldroid";
|
||||
wm.type = "hyprland"; # Define the window manager type here, mangowc will be made possible in the nerar future.
|
||||
# In generated/top.nix the chpice fopr a window manager will be effectuated
|
||||
wm.type = "hyprland"; # Define the window manager type here, mangowc will be made possible in the near future.
|
||||
};
|
||||
}
|
||||
#+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
|
||||
|
||||
|
||||
@@ -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
|
||||
imports = [
|
||||
./boot.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
wm = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -19,7 +19,6 @@
|
||||
description = "Type of window manager to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Minimal settings that must be defined here
|
||||
networking.hostName = "traveldroid";
|
||||
|
||||
+55
-65
@@ -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 = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
# 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;
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user