mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 17:08:25 +02:00
feat: add distributed-builds & many hosts
feat: remove nur & devenv feat: adjust the structure to make it suitable for servers feat: add iso/proxmox generators and add docs about it feat: update ryan's openssh keys & add hashedPassword feat: add proxmox's nodes into ssh_config, with alias
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# My MacBook Pro - Computer for Business
|
||||
{ pkgs, ... } @ args:
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
||||
@@ -1,31 +1,22 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
|
||||
{ config, pkgs, home-manager, nur, ... } @ args:
|
||||
{ config, ... } @ args:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# This adds a nur configuration option.
|
||||
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
|
||||
nur.nixosModules.nur
|
||||
|
||||
./cifs-mount.nix
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
||||
../../modules/nixos/fhs-fonts.nix
|
||||
# ../../modules/nixos/hyprland.nix
|
||||
../../modules/nixos/i3.nix
|
||||
../../modules/nixos/gui-apps.nix
|
||||
../../modules/nixos/core-desktop.nix
|
||||
../../modules/nixos/user_group.nix
|
||||
../../../modules/nixos/fhs-fonts.nix
|
||||
# ../../../modules/nixos/hyprland.nix
|
||||
../../../modules/nixos/i3.nix
|
||||
../../../modules/nixos/core-desktop.nix
|
||||
../../../modules/nixos/remote-building.nix
|
||||
../../../modules/nixos/user-group.nix
|
||||
|
||||
../../secrets
|
||||
../../../secrets
|
||||
];
|
||||
|
||||
nixpkgs.overlays = import ../../overlays args;
|
||||
nixpkgs.overlays = import ../../../overlays args;
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
|
||||
@@ -52,7 +43,7 @@
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "msi-rtx4090"; # Define your hostname.
|
||||
hostName = "ai";
|
||||
wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
@@ -65,7 +56,7 @@
|
||||
interfaces.enp5s0 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.5.66";
|
||||
address = "192.168.5.100";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
};
|
||||
@@ -76,15 +67,16 @@
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.docker.storageDriver = "btrfs";
|
||||
|
||||
# for Nvidia GPU
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ]; # will install nvidia-vaapi-driver by default
|
||||
hardware.nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
};
|
||||
virtualisation.docker.enableNvidia = true; # for nvidia-docker
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
@@ -94,12 +86,6 @@
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
enableNvidia = true;
|
||||
storageDriver = "btrfs";
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
@@ -1,27 +1,20 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{ ... } @args:
|
||||
|
||||
{ config, pkgs, home-manager, nur, ... } @args:
|
||||
#############################################################
|
||||
#
|
||||
# Aquamarine - A NixOS VM running on Proxmox
|
||||
#
|
||||
#############################################################
|
||||
|
||||
{
|
||||
imports = [
|
||||
# This adds a nur configuration option.
|
||||
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
|
||||
nur.nixosModules.nur
|
||||
../../../modules/nixos/proxmox-hardware-configuration.nix
|
||||
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
||||
../../modules/nixos/fhs-fonts.nix
|
||||
../../modules/nixos/hyprland.nix
|
||||
# ../../modules/nixos/i3.nix
|
||||
../../modules/nixos/gui-apps.nix
|
||||
../../modules/nixos/core-desktop.nix
|
||||
../../modules/nixos/user_group.nix
|
||||
../../../modules/nixos/core-server.nix
|
||||
../../../modules/nixos/user-group.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = import ../../overlays args;
|
||||
nixpkgs.overlays = import ../../../overlays args;
|
||||
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
@@ -39,19 +32,8 @@
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/sda"; # "nodev"
|
||||
efiSupport = false;
|
||||
useOSProber = true;
|
||||
#efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work for your system
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "nixos-test"; # Define your hostname.
|
||||
hostName = "aquamarine"; # Define your hostname.
|
||||
wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
@@ -62,7 +44,7 @@
|
||||
interfaces.ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.5.48";
|
||||
address = "192.168.5.101";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
};
|
||||
66
hosts/idols/kana/default.nix
Normal file
66
hosts/idols/kana/default.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{ ... } @args:
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Kana - a NixOS VM running on Proxmox
|
||||
#
|
||||
#############################################################
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../modules/nixos/proxmox-hardware-configuration.nix
|
||||
|
||||
../../../modules/nixos/core-server.nix
|
||||
../../../modules/nixos/user-group.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = import ../../../overlays args;
|
||||
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
|
||||
# supported fil systems, so we can mount any removable disks with these filesystems
|
||||
boot.supportedFilesystems = [
|
||||
"ext4"
|
||||
"btrfs"
|
||||
"xfs"
|
||||
#"zfs"
|
||||
"ntfs"
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "kana"; # Define your hostname.
|
||||
wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# proxy.default = "http://user:password@proxy:port/";
|
||||
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
networkmanager.enable = true;
|
||||
interfaces.ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.5.103";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
};
|
||||
defaultGateway = "192.168.5.201";
|
||||
nameservers = [
|
||||
"119.29.29.29" # DNSPod
|
||||
"223.5.5.5" # AliDNS
|
||||
];
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
68
hosts/idols/ruby/default.nix
Normal file
68
hosts/idols/ruby/default.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{ ... } @args:
|
||||
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Ruby - a NixOS VM running on Proxmox
|
||||
#
|
||||
#############################################################
|
||||
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../modules/nixos/proxmox-hardware-configuration.nix
|
||||
|
||||
../../../modules/nixos/core-server.nix
|
||||
../../../modules/nixos/user-group.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = import ../../../overlays args;
|
||||
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
|
||||
# supported fil systems, so we can mount any removable disks with these filesystems
|
||||
boot.supportedFilesystems = [
|
||||
"ext4"
|
||||
"btrfs"
|
||||
"xfs"
|
||||
#"zfs"
|
||||
"ntfs"
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "ruby"; # Define your hostname.
|
||||
wireless.enable = false; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# proxy.default = "http://user:password@proxy:port/";
|
||||
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
networkmanager.enable = true;
|
||||
interfaces.ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.5.102";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
};
|
||||
defaultGateway = "192.168.5.201";
|
||||
nameservers = [
|
||||
"119.29.29.29" # DNSPod
|
||||
"223.5.5.5" # AliDNS
|
||||
];
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/b779eb19-e43d-4f07-a91f-eb08bd8e1202";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Reference in New Issue
Block a user