nixos-config/flake.nix

127 lines
2.8 KiB
Nix
Raw Normal View History

2021-10-05 23:45:02 +02:00
{
description = "System config";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }@inputs:
let
inherit (nixpkgs) lib;
util = import ./lib {
inherit system pkgs home-manager lib;
overlays = (pkgs.overlays);
};
inherit (util) user;
inherit (util) host;
inherit (import ./pkgs {
inherit pkgs;
}) myPkgs;
2021-10-05 23:45:02 +02:00
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ ];
};
system = "x86_64-linux";
2021-10-07 09:59:54 +02:00
vm1BiosConfig = {
2021-10-05 23:45:02 +02:00
boot = {
2021-10-07 09:59:54 +02:00
type = "bios";
2021-10-05 23:45:02 +02:00
qemu = true;
grubInstallDevice = "/dev/vda";
};
core.enable = true;
};
2021-10-07 09:59:54 +02:00
vm1UefiConfig = {
boot = {
type = "uefi";
qemu = true;
};
core.enable = true;
};
2021-10-05 23:45:02 +02:00
vm2Config = {
boot = {
type = "uefi";
qemu = true;
};
core.enable = true;
};
nixosUsers = [{
name = "erwin";
groups = [ "wheel" "networkmanager" "video" ];
uid = 1000;
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNoTcRsAxDwpiIj6nhUXwzSQjtcgKCR0RDlzP57wi0W erwin@horusvr-ws2"
];
}];
in
{
2021-10-05 23:45:02 +02:00
homeManagerConfigurations = {
erwin = user.mkHMUser {
userConfig = {
git.enable = true;
ssh.enable = true;
applications.enable = true;
gpg.enable = true;
fish.enable = true;
sway.enable = true;
2021-10-05 23:45:02 +02:00
};
username = "erwin";
};
};
nixosConfigurations = {
vm1 = host.mkHost {
name = "vm1";
NICs = [ "enp1s0" ];
kernelPackage = pkgs.linuxPackages;
2021-10-07 09:59:54 +02:00
initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
kernelMods = [ "kvm-amd" ];
2021-10-05 23:45:02 +02:00
kernelParams = [ ];
2021-10-07 09:59:54 +02:00
systemConfig = vm1UefiConfig;
2021-10-05 23:45:02 +02:00
users = nixosUsers;
cpuCores = 6;
};
vm2 = host.mkHost {
name = "vm2";
NICs = [ "enp1s0" ];
kernelPackage = pkgs.linuxPackages;
2021-10-07 09:59:54 +02:00
initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
kernelMods = [ "kvm-amd" ];
2021-10-05 23:45:02 +02:00
kernelParams = [ ];
systemConfig = vm2Config;
users = nixosUsers;
cpuCores = 4;
};
2021-10-07 09:59:54 +02:00
# loki = host.mkHost {
# name = "loki";
# NICs = [ "enp4s0" ];
# kernelPackage = pkgs.linuxPackages;
# initrdMods = [ "nvme" "xhci_pci" "ahci" ];
# kernelMods = [ "kvm-amd" ];
# };
2021-10-05 23:45:02 +02:00
};
};
}