Configure for two machines
This commit is contained in:
63
flake.nix
63
flake.nix
@@ -54,37 +54,42 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
|
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
|
||||||
|
|
||||||
|
mkHost = hostname: nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
./hosts/${hostname}/hardware-configuration.nix
|
||||||
|
./hosts/${hostname}/disko.nix
|
||||||
|
./system
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
powerManagement.enable = true;
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
home-manager = {
|
||||||
|
users.chris = import ./home;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
inherit pkgs-unstable;
|
||||||
|
inherit try-cli;
|
||||||
|
inherit voxtype;
|
||||||
|
inherit walker;
|
||||||
|
inherit impermanence;
|
||||||
|
inherit hostname;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
inherit pkgs-unstable;
|
||||||
|
inherit impermanence;
|
||||||
|
inherit disko;
|
||||||
|
inherit hostname;
|
||||||
|
};
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
stationette = nixpkgs.lib.nixosSystem {
|
stationette = mkHost "stationette";
|
||||||
modules = [
|
station = mkHost "station";
|
||||||
./hardware-configuration.nix
|
|
||||||
./hardware
|
|
||||||
./system
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
powerManagement.enable = true;
|
|
||||||
system.stateVersion = "25.11";
|
|
||||||
home-manager = {
|
|
||||||
users.chris = import ./home;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
inherit pkgs-unstable;
|
|
||||||
inherit try-cli;
|
|
||||||
inherit voxtype;
|
|
||||||
inherit walker;
|
|
||||||
inherit impermanence;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
inherit pkgs-unstable;
|
|
||||||
inherit impermanence;
|
|
||||||
inherit disko;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Standalone home-manager configuration entrypoint
|
# Standalone home-manager configuration entrypoint
|
||||||
|
|||||||
15
hosts/station/hardware-configuration.nix
Normal file
15
hosts/station/hardware-configuration.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
fileSystems."/persist" = {
|
||||||
|
device = "/dev/disk/by-partlabel/disk-station-root";
|
||||||
|
neededForBoot = true;
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=persist" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, hostname, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
boot = {
|
boot = {
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
"splash"
|
"splash"
|
||||||
];
|
];
|
||||||
bootspec.enable = true;
|
bootspec.enable = true;
|
||||||
resumeDevice = "/dev/disk/by-partlabel/disk-stationette-root";
|
resumeDevice = "/dev/disk/by-partlabel/disk-${hostname}-root";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{ ... }:
|
{ hostname, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "stationette";
|
hostName = hostname;
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
wireless = {
|
wireless = {
|
||||||
iwd.enable = true;
|
iwd.enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs, pkgs-unstable, ... }:
|
{ pkgs, pkgs-unstable, hostname, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
withUWSM = true;
|
withUWSM = true;
|
||||||
};
|
};
|
||||||
steam = {
|
steam = {
|
||||||
enable = true;
|
enable = hostname == "station";
|
||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||||
|
|||||||
Reference in New Issue
Block a user