mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-19 16:49:04 +05:30
refactor(hosts): consolidate host configurations
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "alpha";
|
|
||||||
userName = "tux";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.nixos.core
|
|
||||||
config.flake.modules.nixos.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "arcturus";
|
|
||||||
userName = "tux";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.nixos.core
|
|
||||||
config.flake.modules.nixos.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "canopus";
|
|
||||||
userName = "tux";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.nixos.core
|
|
||||||
config.flake.modules.nixos.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
83
modules/hosts/default.nix
Normal file
83
modules/hosts/default.nix
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
mkHost =
|
||||||
|
hostName:
|
||||||
|
{
|
||||||
|
userName ? "tux",
|
||||||
|
userEmail ? "t@tux.rs",
|
||||||
|
system ? "x86_64-linux",
|
||||||
|
unstable ? true,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
||||||
|
in
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
hostName
|
||||||
|
userName
|
||||||
|
userEmail
|
||||||
|
system
|
||||||
|
;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
config.flake.modules.nixos.core
|
||||||
|
config.flake.modules.nixos.${hostName}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
mkDroidHost =
|
||||||
|
hostName:
|
||||||
|
{
|
||||||
|
userName ? "nix-on-droid",
|
||||||
|
userEmail ? "t@tux.rs",
|
||||||
|
system ? "aarch64-linux",
|
||||||
|
unstable ? true,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
||||||
|
in
|
||||||
|
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
joypixels.acceptLicense = true;
|
||||||
|
};
|
||||||
|
overlays = builtins.attrValues inputs.self.overlays;
|
||||||
|
};
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
outputs
|
||||||
|
hostName
|
||||||
|
userName
|
||||||
|
userEmail
|
||||||
|
;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
config.flake.modules.droid.core
|
||||||
|
config.flake.modules.droid.networking
|
||||||
|
config.flake.modules.droid.${hostName}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosConfigurations = builtins.mapAttrs mkHost {
|
||||||
|
alpha = { };
|
||||||
|
arcturus = { };
|
||||||
|
canopus = { };
|
||||||
|
sirius = { };
|
||||||
|
vps = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
flake.nixOnDroidConfigurations = builtins.mapAttrs mkDroidHost {
|
||||||
|
vega = { };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "sirius";
|
|
||||||
userName = "tux";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.nixos.core
|
|
||||||
config.flake.modules.nixos.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
outputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "vega";
|
|
||||||
userName = "nix-on-droid";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "aarch64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixOnDroidConfigurations."${hostName}" = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
system = system;
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
joypixels.acceptLicense = true;
|
|
||||||
};
|
|
||||||
overlays = builtins.attrValues inputs.self.overlays;
|
|
||||||
};
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
outputs
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.droid.core
|
|
||||||
config.flake.modules.droid.networking
|
|
||||||
config.flake.modules.droid.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
hostName = "vps";
|
|
||||||
userName = "tux";
|
|
||||||
userEmail = "t@tux.rs";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = true;
|
|
||||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
hostName
|
|
||||||
userName
|
|
||||||
userEmail
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
config.flake.modules.nixos.core
|
|
||||||
config.flake.modules.nixos.${hostName}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user