From b313c0b3ba17db8cc802ec59c1443ac7357c2567 Mon Sep 17 00:00:00 2001 From: Random936 Date: Wed, 17 Jul 2024 14:59:45 -0700 Subject: [PATCH] Added config for sampledb-dev --- config/config.nix | 21 +++++++++++++++++++++ config/sampledb.nix | 21 +++++++++++++++++++++ flake.nix | 16 ++++++++++++++++ hardware/sampledb.nix | 31 +++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 config/config.nix create mode 100644 config/sampledb.nix create mode 100644 hardware/sampledb.nix diff --git a/config/config.nix b/config/config.nix new file mode 100644 index 0000000..f420778 --- /dev/null +++ b/config/config.nix @@ -0,0 +1,21 @@ +{ config, pkgs, inputs, ... }: { + + imports = [ + ../hardware/media.nix + ./headless.nix + ]; + + users.users.media = import ./user.nix; + networking.hostName = "r330-media"; + + # Conigure a static IP address. + networking.defaultGateway = "192.168.8.1"; + networking.nameservers = [ "192.168.8.1" ]; + networking.firewall.allowedTCPPorts = [ 80 443 32400 ]; + networking.interfaces.ens18.ipv4.addresses = [ + { + address = "192.168.8.5"; + prefixLength = 24; + } + ]; +} diff --git a/config/sampledb.nix b/config/sampledb.nix new file mode 100644 index 0000000..c8a9128 --- /dev/null +++ b/config/sampledb.nix @@ -0,0 +1,21 @@ +{ config, pkgs, inputs, ... }: { + + imports = [ + ../hardware/sampledb.nix + ./headless.nix + ]; + + users.users.sampledb = import ./user.nix; + networking.hostName = "sampledb-dev"; + + # Conigure a static IP address. + networking.defaultGateway = "192.168.8.1"; + networking.nameservers = [ "192.168.8.1" ]; + networking.firewall.allowedTCPPorts = [ 80 443 32400 ]; + networking.interfaces.ens18.ipv4.addresses = [ + { + address = "192.168.8.7"; + prefixLength = 24; + } + ]; +} diff --git a/flake.nix b/flake.nix index 198b5e8..f5404c8 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,22 @@ ]; }; + homeConfigurations.sampledb = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + extraSpecialArgs.user = "sampledb"; + modules = [ + ./home/headless-nixos.nix + ]; + }; + + nixosConfigurations."sampledb-dev" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./config/sampledb.nix + ]; + }; + homeConfigurations.media = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages."x86_64-linux"; extraSpecialArgs.user = "media"; diff --git a/hardware/sampledb.nix b/hardware/sampledb.nix new file mode 100644 index 0000000..ea855b1 --- /dev/null +++ b/hardware/sampledb.nix @@ -0,0 +1,31 @@ +# 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/bc530c66-1e41-4c32-9ea0-e9e644677300"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}