summaryrefslogtreecommitdiff
path: root/nixosConfigurations/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-12-17 16:39:09 +0300
committerAzat Bahawi <azat@bahawi.net>2022-12-17 16:39:09 +0300
commit8f137c28230623259a964484adcf31fe00756594 (patch)
tree82bce6a13fda125087cf6d9dc80aa91d9230d6c4 /nixosConfigurations/default.nix
parent3229e56e0d3620ddc735edcfbbefb167efa3b23f (diff)
2022-12-17
Diffstat (limited to 'nixosConfigurations/default.nix')
-rw-r--r--nixosConfigurations/default.nix96
1 files changed, 96 insertions, 0 deletions
diff --git a/nixosConfigurations/default.nix b/nixosConfigurations/default.nix
new file mode 100644
index 0000000..8ebeda4
--- /dev/null
+++ b/nixosConfigurations/default.nix
@@ -0,0 +1,96 @@
+{
+ inputs,
+ lib,
+}:
+with lib; let
+ mkConfiguration = name: {
+ modules ? [],
+ configuration ? ./${name},
+ this ? my.configurations.${name},
+ extraSpecialArgs ? {
+ localUsername = my.username;
+ localHostname = this.hostname;
+ },
+ }:
+ nameValuePair name (nixosSystem {
+ inherit (this) system;
+ modules =
+ modules
+ ++ attrValues inputs.self.modules
+ ++ attrValues inputs.self.nixosModules
+ ++ optional (configuration != null) (import configuration);
+ specialArgs =
+ {
+ inherit inputs lib this;
+ }
+ // extraSpecialArgs;
+ });
+in
+ mapAttrs' mkConfiguration {
+ # A dummy configuration to test the "headless" profile.
+ test-headless = {
+ modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixpkgs.nixosModules.notDetected
+ ];
+ this = {
+ hostname = "test-headless";
+ system = "x86_64-linux";
+ isHeadless = true;
+ isHeadful = false;
+ };
+ };
+
+ # A dummy configuration to test the "headful" profile.
+ test-headful = {
+ modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixpkgs.nixosModules.notDetected
+ ];
+ this = {
+ hostname = "test-headful";
+ system = "x86_64-linux";
+ isHeadless = false;
+ isHeadful = true;
+ };
+ };
+
+ # A beefy desktop: 7950x/rx6750xt/128GB.
+ eonwe.modules = with inputs; [
+ nixos-hardware.nixosModules.common-cpu-amd
+ nixos-hardware.nixosModules.common-gpu-amd
+ nixos-hardware.nixosModules.common-pc-ssd
+ nixpkgs.nixosModules.notDetected
+ ];
+
+ # ThinkPad T480.
+ melian.modules = with inputs; [
+ nixos-hardware.nixosModules.common-pc-laptop-ssd
+ nixos-hardware.nixosModules.lenovo-thinkpad-t480
+ nixpkgs.nixosModules.notDetected
+ ];
+
+ # VPS: Germany
+ manwe.modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixos-hardware.nixosModules.common-cpu-amd
+ nixos-hardware.nixosModules.common-pc-ssd
+ nixpkgs.nixosModules.notDetected
+ ];
+
+ # VPS: Germany
+ varda.modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixos-hardware.nixosModules.common-cpu-amd
+ nixos-hardware.nixosModules.common-pc-ssd
+ nixpkgs.nixosModules.notDetected
+ ];
+
+ # VPS: France
+ yavanna.modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixos-hardware.nixosModules.common-cpu-intel
+ nixos-hardware.nixosModules.common-pc-hdd
+ nixpkgs.nixosModules.notDetected
+ ];
+ }