docs: ideas

This commit is contained in:
truxnell 2024-03-23 20:45:09 +11:00
parent d27d81b420
commit 5923c726bd
3 changed files with 72 additions and 5 deletions

View file

@ -49,7 +49,7 @@
# Use nixpkgs-fmt for 'nix fmt' # Use nixpkgs-fmt for 'nix fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixpkgs-fmt); formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixpkgs-fmt);
nixosModules = import ./nixos/modules/nixos; # nixosModules = import ./nixos/modules/nixos;
nixosConfigurations = nixosConfigurations =
let let
@ -61,6 +61,27 @@
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
}; };
# generate a base nixos configuration with the
# specified overlays, hardware modules, and any extraModules applied
mkNixosConfig =
{ hostname
, system ? "x86_64-linux"
, nixpkgs ? inputs.nixpkgs
, hardwareModules
, baseModules ? [
# home-manager.nixosModules.home-manager
# ./modules/nixos
sops-nix.nixosModules.sops
./nixos/hosts/${hostname}
]
, extraModules ? [ ]
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules = baseModules ++ hardwareModules ++ extraModules;
specialArgs = { inherit self inputs nixpkgs; };
};
in in
{ {
nixosvm = nixpkgs.lib.nixosSystem { nixosvm = nixpkgs.lib.nixosSystem {
@ -71,14 +92,45 @@
]; ];
}; };
rickenbacker = nixpkgs.lib.nixosSystem { # rickenbacker = nixpkgs.lib.nixosSystem {
inherit specialArgs; # inherit specialArgs;
# system = "x86_64-linux";
# modules = defaultModules ++ [
# ./nixos/hosts/rickenbacker
# ];
# };
"rickenbacker" = mkNixosConfig {
hostname = "rickenbacker";
system = "x86_64-linux"; system = "x86_64-linux";
modules = defaultModules ++ [ hardwareModules = [
./nixos/hosts/rickenbacker # ./modules/hardware/phil.nix
];
extraModules = [
# ./profiles/personal.nix
]; ];
}; };
"citadel" = mkNixosConfig {
hostname = "citadel";
system = "x86_64-linux";
hardwareModules = [
# ./modules/hardware/phil.nix
];
extraModules = [
# ./profiles/personal.nix
];
};
# "kclejeune@aarch64-linux" = mkNixosConfig {
# system = "aarch64-linux";
# hardwareModules = [./modules/hardware/phil.nix];
# extraModules = [./profiles/personal.nix];
# };
dns01 = nixpkgs.lib.nixosSystem { dns01 = nixpkgs.lib.nixosSystem {
inherit specialArgs; inherit specialArgs;
system = "aarch64-linux"; system = "aarch64-linux";

View file

@ -3,6 +3,7 @@
, lib , lib
, ... , ...
}: { }: {
# TODO add USER settings.json
# Enable vscode & addons # Enable vscode & addons
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(vscode-with-extensions.override { (vscode-with-extensions.override {

14
nixos/modules/README.md Normal file
View file

@ -0,0 +1,14 @@
Profiles:
Global: Settings for entire site - time local, chrony, timeservers, dns
Role: What the role is of the device - graphical/server
Hardware: Specifics of hardware (hw overlays, rpi4, etc)
Host: Host-specific (services, user setup)
nixos
system
locale
time
openssh
fish
chrony