From 5923c726bd5afa33aa5d744c4b1d664ba3db2724 Mon Sep 17 00:00:00 2001 From: truxnell <19149206+truxnell@users.noreply.github.com> Date: Sat, 23 Mar 2024 20:45:09 +1100 Subject: [PATCH] docs: ideas --- flake.nix | 62 +++++++++++++++++-- .../optional/editors/vscode/default.nix | 1 + nixos/modules/README.md | 14 +++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 nixos/modules/README.md diff --git a/flake.nix b/flake.nix index 772e4bd..eda0fb3 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ # Use nixpkgs-fmt for 'nix fmt' formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixpkgs-fmt); - nixosModules = import ./nixos/modules/nixos; + # nixosModules = import ./nixos/modules/nixos; nixosConfigurations = let @@ -61,6 +61,27 @@ specialArgs = { 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 { nixosvm = nixpkgs.lib.nixosSystem { @@ -71,14 +92,45 @@ ]; }; - rickenbacker = nixpkgs.lib.nixosSystem { - inherit specialArgs; + # rickenbacker = nixpkgs.lib.nixosSystem { + # inherit specialArgs; + # system = "x86_64-linux"; + # modules = defaultModules ++ [ + # ./nixos/hosts/rickenbacker + # ]; + # }; + + "rickenbacker" = mkNixosConfig { + hostname = "rickenbacker"; system = "x86_64-linux"; - modules = defaultModules ++ [ - ./nixos/hosts/rickenbacker + hardwareModules = [ + # ./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 { inherit specialArgs; system = "aarch64-linux"; diff --git a/nixos/hosts/common/optional/editors/vscode/default.nix b/nixos/hosts/common/optional/editors/vscode/default.nix index 59fd27d..5a3f682 100644 --- a/nixos/hosts/common/optional/editors/vscode/default.nix +++ b/nixos/hosts/common/optional/editors/vscode/default.nix @@ -3,6 +3,7 @@ , lib , ... }: { + # TODO add USER settings.json # Enable vscode & addons environment.systemPackages = with pkgs; [ (vscode-with-extensions.override { diff --git a/nixos/modules/README.md b/nixos/modules/README.md new file mode 100644 index 0000000..fe8ab4a --- /dev/null +++ b/nixos/modules/README.md @@ -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