more stuff

This commit is contained in:
Kopatz
2024-04-17 16:33:12 +02:00
parent 468c978e62
commit 6a891bec61
35 changed files with 177 additions and 74 deletions

View File

@@ -105,6 +105,23 @@
home-manager.nixosModules.home-manager
];
};
nixosConfigurations."vm" = nixpkgs-unstable.lib.nixosSystem {
inherit system;
specialArgs = {
vars = import ./systems/userdata-default.nix // import ./systems/pc/userdata.nix;
pkgsVersion = nixpkgs-unstable;
inherit inputs outputs;
};
modules = [
./modules
./users/vm
./modules/collections/desktop.nix
./systems/pc/configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = with outputs.overlays; [additions modifications unstable-packages nur.overlay]; })
agenix.nixosModules.default
home-manager-unstable.nixosModules.home-manager
];
};
nixosConfigurations."wsl" = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {

View File

@@ -11,7 +11,7 @@
../support/ntfs.nix
];
kop = {
custom = {
tmpfs.enable = true;
wireshark.enable = true;
virt-manager.enable = true;

View File

@@ -3,7 +3,7 @@
imports = [
../graphical/hyprland.nix # TODO
];
kop = {
custom = {
cli-tools.enable = true;
tmpfs.enable = true;
wireshark.enable = true;

View File

@@ -31,7 +31,7 @@
../static-ip.nix
];
kop = {
custom = {
cli-tools.enable = true;
tmpfs.enable = true;
nix = {

View File

@@ -1,10 +1,10 @@
{config, lib, pkgs, ...} :
with lib;
let
cfg = config.kop.graphical.audio;
cfg = config.custom.graphical.audio;
in
{
options.kop.graphical.audio = {
options.custom.graphical.audio = {
enable = mkEnableOption "Enables audio";
};

View File

@@ -1,10 +1,10 @@
{ config, pkgs, inputs, lib, ... }:
with lib;
let
cfg = config.kop.graphical.code;
cfg = config.custom.graphical.code;
in
{
options.kop.graphical.code = {
options.custom.graphical.code = {
enable = mkEnableOption "Enables code";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.kop.graphical.emulators;
cfg = config.custom.graphical.emulators;
in
{
options.kop.graphical.emulators = {
options.custom.graphical.emulators = {
enable = mkEnableOption "Enables emulators";
};

View File

@@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.kop.graphical.gamemode;
cfg = config.custom.graphical.gamemode;
in
{
options.kop.graphical.gamemode = {
options.custom.graphical.gamemode = {
enable = mkEnableOption "Enables gamemode";
};

View File

@@ -1,10 +1,10 @@
{config, lib, pkgs, ...}:
with lib;
let
cfg = config.kop.graphical.games;
cfg = config.custom.graphical.games;
in
{
options.kop.graphical.games = {
options.custom.graphical.games = {
enable = mkEnableOption "Enables games";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, mainUser, ... }:
with lib;
let
cfg = config.kop.graphical.gnome;
cfg = config.custom.graphical.gnome;
in
{
options.kop.graphical.gnome = {
options.custom.graphical.gnome = {
enable = mkEnableOption "Enables gnome";
};

View File

@@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.kop.graphical.ime;
cfg = config.custom.graphical.ime;
in
{
options.kop.graphical.ime = {
options.custom.graphical.ime = {
enable = mkEnableOption "Enables ime";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.kop.graphical.lxqt;
cfg = config.custom.graphical.lxqt;
in
{
options.kop.graphical.lxqt = {
options.custom.graphical.lxqt = {
enable = mkEnableOption "Enables lxqt";
};

View File

@@ -1,10 +1,10 @@
{config, lib, pkgs, ...}:
with lib;
let
cfg = config.kop.graphical.noise-supression;
cfg = config.custom.graphical.noise-supression;
in
{
options.kop.graphical.noise-supression = {
options.custom.graphical.noise-supression = {
enable = mkEnableOption "Enables noise-supression";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.kop.graphical.obs;
cfg = config.custom.graphical.obs;
in
{
options.kop.graphical.obs = {
options.custom.graphical.obs = {
enable = mkEnableOption "Enables obs";
};

View File

@@ -1,10 +1,10 @@
{config, lib, pkgs, ...}:
with lib;
let
cfg = config.kop.graphical.openrgb;
cfg = config.custom.graphical.openrgb;
in
{
options.kop.graphical.openrgb = {
options.custom.graphical.openrgb = {
enable = mkEnableOption "Enables openrgb";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ... }:
with lib;
let
cfg = config.kop.graphical.plasma;
cfg = config.custom.graphical.plasma;
in
{
options.kop.graphical.plasma = {
options.custom.graphical.plasma = {
enable = mkEnableOption "Enables plasma";
};

View File

@@ -1,10 +1,10 @@
{ config, pkgs, inputs, lib, ... }:
with lib;
let
cfg = config.kop.graphical.shared;
cfg = config.custom.graphical.shared;
in
{
options.kop.graphical.shared = {
options.custom.graphical.shared = {
enable = mkEnableOption "Enables shared";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.hardware.firmware;
cfg = config.custom.hardware.firmware;
in
{
options.kop.hardware.firmware = {
options.custom.hardware.firmware = {
enable = mkEnableOption "Enables firmware";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.kop.hardware.nvidia;
cfg = config.custom.hardware.nvidia;
in
{
options.kop.hardware.nvidia = {
options.custom.hardware.nvidia = {
enable = mkEnableOption "Enables nvidia gpus";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.hardware.scheduler;
cfg = config.custom.hardware.scheduler;
in
{
options.kop.hardware.scheduler = {
options.custom.hardware.scheduler = {
enable = mkEnableOption "Enables scheduler";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.hardware.ssd;
cfg = config.custom.hardware.ssd;
in
{
options.kop.hardware.ssd = {
options.custom.hardware.ssd = {
enable = mkEnableOption "Enables fstrim";
};

View File

@@ -1,10 +1,10 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.kop.hardware.vfio;
cfg = config.custom.hardware.vfio;
in
{
options.kop.hardware.vfio = {
options.custom.hardware.vfio = {
enable = mkEnableOption "Enables vfio";
};

View File

@@ -1,10 +1,10 @@
{ config, pkgs, lib, ...}:
with lib;
let
cfg = config.kop.hardware.wooting;
cfg = config.custom.hardware.wooting;
in
{
options.kop.hardware.wooting = {
options.custom.hardware.wooting = {
enable = mkEnableOption "Enable wooting hardware support";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.kop.cli-tools;
cfg = config.custom.cli-tools;
in
{
options.kop.cli-tools = {
options.custom.cli-tools = {
enable = mkEnableOption "Enables cli-tools";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.nftables;
cfg = config.custom.nftables;
in
{
options.kop.nftables = {
options.custom.nftables = {
enable = mkEnableOption "Enables nftables";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.tmpfs;
cfg = config.custom.tmpfs;
in
{
options.kop.tmpfs = {
options.custom.tmpfs = {
enable = mkEnableOption "Enables tmpfs";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ... }:
with lib;
let
cfg = config.kop.virt-manager;
cfg = config.custom.virt-manager;
in
{
options.kop.virt-manager = {
options.custom.virt-manager = {
enable = mkEnableOption "Enables virt-manager";
};

View File

@@ -1,10 +1,10 @@
{lib, config, pkgs, ... }:
with lib;
let
cfg = config.kop.wireshark;
cfg = config.custom.wireshark;
in
{
options.kop.wireshark = {
options.custom.wireshark = {
enable = mkEnableOption "Enables wireshark";
};

View File

@@ -1,10 +1,10 @@
{config, lib, ...}:
with lib;
let
cfg = config.kop.nix.index;
cfg = config.custom.nix.index;
in
{
options.kop.nix.index = {
options.custom.nix.index = {
enable = mkEnableOption "Enables nix index";
};

View File

@@ -1,10 +1,10 @@
{config, lib, pkgs, ... }:
with lib;
let
cfg = config.kop.nix.ld;
cfg = config.custom.nix.ld;
in
{
options.kop.nix.ld = {
options.custom.nix.ld = {
enable = mkEnableOption "Enables nix ld";
};

View File

@@ -1,10 +1,10 @@
{lib, inputs, config, pkgsVersion, ... }:
with lib;
let
cfg = config.kop.nix.settings;
cfg = config.custom.nix.settings;
in
{
options.kop.nix.settings = {
options.custom.nix.settings = {
enable = mkEnableOption "Enables various nix settings";
};

View File

@@ -0,0 +1,23 @@
{pkgs, config, ...}:
{
mainUser.layout = "de";
mainUser.variant = "us";
custom = {
user = {
name = "vm";
layout = "de";
variant = "us";
};
cli-tools.enable = true;
nix = {
index.enable = true;
ld.enable = true;
settings.enable = true;
};
graphical = {
plasma.enable = true;
shared.enable = true;
};
};
}

View File

@@ -1,23 +1,45 @@
{lib, config, pkgs, ...}:
{
options.mainUser = {
name = lib.mkOption {
default = "mainuser";
description = ''
username
'';
options = {
mainUser = {
name = lib.mkOption {
default = "mainuser";
description = ''
username
'';
};
layout = lib.mkOption {
default = "de";
description = "keyboard layout";
};
variant = lib.mkOption {
default = "";
description = "keyboard variant";
};
sshKey = lib.mkOption {
default = throw "No ssh key specified";
description = "Public key of the user";
};
};
layout = lib.mkOption {
default = "de";
description = "keyboard layout";
};
variant = lib.mkOption {
default = "";
description = "keyboard variant";
};
sshKey = lib.mkOption {
default = throw "No ssh key specified";
description = "Public key of the user";
kop.user = {
name = lib.mkOption {
default = "mainuser";
description = ''
username
'';
};
layout = lib.mkOption {
default = "de";
description = "keyboard layout";
};
variant = lib.mkOption {
default = "";
description = "keyboard variant";
};
sshKey = lib.mkOption {
default = throw "No ssh key specified";
description = "Public key of the user";
};
};
};
}

29
users/vm/default.nix Normal file
View File

@@ -0,0 +1,29 @@
{ inputs
, pkgs
, lib
, config
, ...
}:
{
imports = [ ../default.nix ];
mainUser.name = "vm";
virtualisation.vmVariant = {
virtualisation = {
memorySize = 4096; # Use 2048MiB memory.
cores = 4;
};
};
home-manager = {
users.${config.mainUser.name} = import ./home.nix;
};
programs.zsh.enable = true;
users.users.${config.mainUser.name} = {
isNormalUser = true ;
initialPassword = "test";
description = config.mainUser.name;
shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" "docker" ];
};
}

12
users/vm/home.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, inputs, ...}:
{
home = {
stateVersion = "23.05";
};
imports = [
../../home-manager/nvim.nix
../../home-manager/zsh.nix
inputs.nix-colors.homeManagerModule
];
}