added options to build with to avoid removing and re-adding stuff
This commit is contained in:
parent
90b5d970be
commit
066b65c34c
8 changed files with 81 additions and 56 deletions
|
@ -1,6 +1,7 @@
|
|||
{ config, pkgs, ... }: {
|
||||
imports = [
|
||||
./hardware-config.nix
|
||||
./options.nix
|
||||
];
|
||||
|
||||
networking.hostName = "desktop";
|
||||
|
|
5
devices/desktop/options.nix
Normal file
5
devices/desktop/options.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
withNiri = false;
|
||||
withGnome = true;
|
||||
withVM = false;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./hardware-config.nix
|
||||
./options.nix
|
||||
];
|
||||
|
||||
networking.hostName = "surface";
|
||||
|
|
5
devices/surface/options.nix
Normal file
5
devices/surface/options.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
withNiri = false;
|
||||
withGnome = true;
|
||||
withVM = false;
|
||||
}
|
|
@ -2,16 +2,23 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
withNiri = with lib; mkEnableOption "Enable niri";
|
||||
withGnome = with lib; mkEnableOption "Enable gnome";
|
||||
withVM = with lib; mkEnableOption "Enable VM related configuration";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./audio.nix
|
||||
./containers.nix
|
||||
./fonts.nix
|
||||
./gnome
|
||||
./niri
|
||||
./virt.nix
|
||||
];
|
||||
|
||||
|
||||
config = {
|
||||
# Allow packages from nixpkgs
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
|
@ -78,4 +85,5 @@
|
|||
description = "twoneis";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{ pkgs, lib, config, ... }: lib.mkIf (config.withGnome) {
|
||||
# Enable the GNOME Desktop Environment.
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{ ... }: {
|
||||
{ lib, config, ... }: lib.mkIf (config.withNiri) {
|
||||
programs.niri.enable = true;
|
||||
}
|
||||
|
|
5
modules/system/virt.nix
Normal file
5
modules/system/virt.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ lib, config, ... }: lib.mkIf (config.withVM) {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
users.users.twoneis.extraGroups = [ "libvirtd" ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue