Browse Source

Add some presets and configuration for haless-03

Sven Slootweg 1 year ago
parent
commit
c574356ec5

+ 26 - 0
configuration/default.nix

@ -0,0 +1,26 @@
1
let
2
	nixpkgsOptions = {};
3
	pkgs = (import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz") nixpkgsOptions);
4
	presets = {
5
		base = (import ./presets/base.nix);
6
		kvm = (import ./presets/kvm.nix);
7
	};
8
in  {
9
	network = {
10
		inherit pkgs;
11
		description = "Cryto";
12
	};
13
14
	"machine-haless-03.cryto.net" = {
15
		system.stateVersion = "19.03";
16
17
		imports = [
18
			presets.base
19
			presets.kvm
20
			./hardware-configurations/machine-haless-03.nix
21
		];
22
23
		services.nginx.enable = true;
24
		networking.firewall.allowedTCPPorts = [ 80 ];
25
	};
26
}

+ 30 - 0
configuration/hardware-configurations/machine-haless-03.nix

@ -0,0 +1,30 @@
1
# Do not modify this file!  It was generated by ‘nixos-generate-config’
2
# and may be overwritten by future invocations.  Please make changes
3
# to /etc/nixos/configuration.nix instead.
4
{ config, lib, pkgs, ... }:
5
6
{
7
  imports =
8
    [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
9
    ];
10
11
  boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "sd_mod" "sr_mod" ];
12
  boot.kernelModules = [ ];
13
  boot.extraModulePackages = [ ];
14
15
  fileSystems."/" =
16
    { device = "/dev/disk/by-uuid/fae209f9-45d5-457a-bccf-c38e7e41c5b9";
17
      fsType = "ext4";
18
    };
19
20
  fileSystems."/boot" =
21
    { device = "/dev/disk/by-uuid/311156df-3b74-4f69-8a1e-ee33c0aa0a33";
22
      fsType = "ext4";
23
    };
24
25
  swapDevices =
26
    [ { device = "/dev/disk/by-uuid/18ff8fb6-047d-4ea4-a32c-39a9f28a0c5d"; }
27
    ];
28
29
  nix.maxJobs = lib.mkDefault 2;
30
}

+ 36 - 0
configuration/presets/base.nix

@ -0,0 +1,36 @@
1
{ pkgs, ... }:
2
	{
3
		i18n = {
4
			consoleFont = "Lat2-Terminus16";
5
			consoleKeyMap = "us";
6
			defaultLocale = "en_US.UTF-8";
7
		};
8
9
		time.timeZone = "Europe/Amsterdam";
10
11
		environment.systemPackages = with pkgs; [
12
			wget
13
			curl
14
			htop
15
			iotop
16
			iftop
17
			nload
18
			lsof
19
		];
20
21
		services.openssh = {
22
			enable = true;
23
			passwordAuthentication = false;
24
			permitRootLogin = "yes";
25
		};
26
27
		users.users.root.openssh.authorizedKeys.keys = [
28
			"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzV5dI01NhwuL6ayiO0STcSQiDf7lEtu63NuLZKQUdZVuVHIqyt3Gquks2OI1NZGrJdXA315yw89ZqyMo+z7gSGHEV6P0fAXKW6G78JOFWsA5lGpaLxTsZ6Q7r0Z9FMqDvA5Jlsyznyj9hhO1cz01WPLzB92ypd9ifldtrAQIYQItxGXOuRkBJiShuIRqtr4Q2chXiOoRZKb4v4Gyt/UPxTpvfM/zcOz0zi1d4ijSbLqgIUJhxvrWADfdgEQ77unepDoD+HT51QBX7dj8RuYivxLSA3vpfNeCgt2CYBf6FYnmWkWSnN1RCtQPJNxsMuLzC2ZBbIkz0tDgcIBPbHxGr sven@linux-rfa7.site"
29
		];
30
31
		nix.gc = {
32
			automatic = true;
33
			dates = "00:00";
34
			options = "--delete-older-than 14d";
35
		};
36
	}

+ 7 - 0
configuration/presets/kvm.nix

@ -0,0 +1,7 @@
1
{
2
	boot.loader.grub = {
3
		enable = true;
4
		version = 2;
5
		device = "/dev/sda"; # or "nodev" for efi only
6
	};
7
}