Skip to content

Commit

Permalink
Merge pull request #56 from erictossell/develop
Browse files Browse the repository at this point in the history
Working Win11 Virt
  • Loading branch information
erictossell authored Nov 21, 2023
2 parents b226f15 + c9bccd9 commit bdadc32
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 62 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ Modules are grouped to be ***almost*** purely *functional* and as a result you w

This repo has become more opinionated over time and now requires passing down variables from the `flake.nix` in order to fetch appropriate modules and packages and eventually theming elements.

#### Flake Github URLS

Transparency is cool.
[nixpkgs: nixos-unstable](https://github.com/NixOS/nixpkgs)
[home-manager: following nixpkgs](https://github.com/nix-community/home-manager/blob/master/flake.nix)
[agenix: following nixpkgs](https://github.com/ryantm/agenix/blob/main/flake.nix)
[hyprland](https://github.com/hyprwm/Hyprland/blob/main/flake.nix)
[eriixvim: my nixvim flake](https://github.com/erictossell/eriixvim/blob/main/flake.nix)

##### These Diagrams are ever so slightly out of date, I hope to update them soon.
![Flake Structure](docs/screens/FlakeStructure4.png)

![Flake Profiles](docs/screens/FlakeProfiles3.png)
Expand Down Expand Up @@ -97,10 +107,6 @@ October 2023
- WM: [hyprland](https://hyprland.org/)
- Most core modules (no extra toys)

### To Be Done

- Flake Neovim configuration, use nixvim

[How to use this repo](docs/usage.md)

[Getting Started with NixOS Minimal](docs/minimal-install.md)
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These steps assume that you have already installed NixOS.

For documentation on how to complete a minimal NixOS install: [Minimal Install](minimal-install.md)

There are no inherit advantages to using the minimal installation as opposed to the GUI. If you want to enable LUKS without manually encrypting your drive, use the GUI.
There are no inherent advantages to using the minimal installation as opposed to the GUI. If you want to enable LUKS without manually encrypting your drive, use the GUI.

### 1. Fetch the flake template

Expand Down
32 changes: 16 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@

nixosConfigurations = {

principium = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
principium =
let system = "x86_64-linux";
in nixpkgs.lib.nixosSystem {
specialArgs = {
username = "eriim";
hostname = "principium";
displayConfig = "desktop";
hyprlandConfig = "desktop";
nvidia_bool = "enabled";
inherit system;
} // attrs;
modules = [
./.
Expand All @@ -44,25 +46,29 @@
];
};#principium

sisyphus = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
sisyphus =
let system = "x86_64-linux";
in nixpkgs.lib.nixosSystem {
specialArgs = {
username = "eriim";
hostname = "sisyphus";
displayConfig = "laptop";
hyprlandConfig = "laptop";
nvidia_bool = "disabled";
inherit system;
} // attrs;
modules = [
./.
];
};#sisyphus

live-image = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
live-image =
let system = "x86_64-linux";
in nixpkgs.lib.nixosSystem {
system = system;
specialArgs = {
username = "nixos";
hostname = "live-image";
displayConfig = "laptop";
hyprlandConfig = "laptop";
nvidia_bool = "disabled";
} // attrs;
modules = [
Expand Down
4 changes: 2 additions & 2 deletions modules/agenix/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ agenix, ... }:
{ agenix, system, ... }:
{
imports = [
agenix.nixosModules.default
];
environment.systemPackages = [ agenix.packages.x86_64-linux.default ];
environment.systemPackages = [ agenix.packages.${system}.default ];
}
2 changes: 1 addition & 1 deletion modules/core/pkgs/core/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{pkgs, ...}:
with pkgs; [
awscli2
#awscli2
brightnessctl
cachix
pavucontrol
Expand Down
4 changes: 2 additions & 2 deletions modules/hyprland/config/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, displayConfig, home-manager, username, ... }:
{ pkgs, hyprlandConfig, home-manager, username, ... }:
let
dotfiles = {
"laptop" = [ (import ./laptop.nix { inherit home-manager username; }) ];
Expand All @@ -7,5 +7,5 @@ let
in
{
imports = [
] ++ (dotfiles.${displayConfig} or [ ]);
] ++ (dotfiles.${hyprlandConfig} or [ ]);
}
4 changes: 2 additions & 2 deletions modules/hyprland/waybar/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, displayConfig, home-manager, username, ... }:
{ pkgs, hyprlandConfig, home-manager, username, ... }:
let
dotfiles = {
"laptop" = [ (import ./laptop.nix { inherit home-manager username; }) ];
Expand All @@ -7,6 +7,6 @@ let
in
{
imports = [
] ++ (dotfiles.${displayConfig} or [ ]);
] ++ (dotfiles.${hyprlandConfig} or [ ]);
environment.systemPackages = with pkgs; [ waybar ];
}
8 changes: 8 additions & 0 deletions modules/network/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
networking = {
networkmanager.enable = true;
hostName = "${hostname}";
extraHosts = ''
10.0.0.195 nixbox
10.0.0.196 nixboard
10.0.0.197 nixcube
10.0.0.198 piZW0
10.0.0.199 piZW1
'';
};
users.users.${username} = {
extraGroups = [ "networkmanager" ];
};

}
43 changes: 19 additions & 24 deletions modules/virt/libvirt.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
{ config, pkgs, home-manager, username, ... }:
{
# Enable virtual machines with qemu
virtualisation.libvirtd = {
enable = true;

qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [
(pkgs.OVMFFull.override {
secureBoot = true;
tpmSupport = true;
})
];
virtualisation = {
libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [ pkgs.OVMFFull.fd ];
};
};
spiceUSBRedirection.enable = true;
};
services.spice-vdagentd.enable = true;

# User permissions
users.users.${username}.extraGroups = [ "libvirtd" ];

# Also recomended to install virt-manager in your packages if you want a GUI
environment.systemPackages = with pkgs; [ OVMF virt-manager virt-viewer ];
environment.etc = {
"ovmf/edk2-x86_64-secure-code.fd" = {
source = config.virtualisation.libvirtd.qemu.package + "/share/qemu/edk2-x86_64-secure-code.fd";
};

"ovmf/edk2-i386-vars.fd" = {
source = config.virtualisation.libvirtd.qemu.package + "/share/qemu/edk2-i386-vars.fd";
};
};
environment.systemPackages = with pkgs; [
spice
spice-gtk
spice-protocol
virt-manager
virt-viewer
win-virtio
win-spice
];

home-manager.users.${username} = { pkgs, ... }: {
dconf.settings = {
Expand Down

0 comments on commit bdadc32

Please sign in to comment.