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 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 { nixosConfigurations."wsl" = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
{lib, inputs, config, pkgsVersion, ... }: {lib, inputs, config, pkgsVersion, ... }:
with lib; with lib;
let let
cfg = config.kop.nix.settings; cfg = config.custom.nix.settings;
in in
{ {
options.kop.nix.settings = { options.custom.nix.settings = {
enable = mkEnableOption "Enables various 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, ...}: {lib, config, pkgs, ...}:
{ {
options.mainUser = { options = {
name = lib.mkOption { mainUser = {
default = "mainuser"; name = lib.mkOption {
description = '' default = "mainuser";
username 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 { kop.user = {
default = "de"; name = lib.mkOption {
description = "keyboard layout"; default = "mainuser";
}; description = ''
variant = lib.mkOption { username
default = ""; '';
description = "keyboard variant"; };
}; layout = lib.mkOption {
sshKey = lib.mkOption { default = "de";
default = throw "No ssh key specified"; description = "keyboard layout";
description = "Public key of the user"; };
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
];
}