diff --git a/flake.nix b/flake.nix index 1ba372a..5c94402 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { diff --git a/modules/collections/desktop.nix b/modules/collections/desktop.nix index 088ad07..d6d7b1c 100644 --- a/modules/collections/desktop.nix +++ b/modules/collections/desktop.nix @@ -11,7 +11,7 @@ ../support/ntfs.nix ]; - kop = { + custom = { tmpfs.enable = true; wireshark.enable = true; virt-manager.enable = true; diff --git a/modules/collections/laptop.nix b/modules/collections/laptop.nix index 6dc1b4f..95e18a5 100644 --- a/modules/collections/laptop.nix +++ b/modules/collections/laptop.nix @@ -3,7 +3,7 @@ imports = [ ../graphical/hyprland.nix # TODO ]; - kop = { + custom = { cli-tools.enable = true; tmpfs.enable = true; wireshark.enable = true; diff --git a/modules/collections/server.nix b/modules/collections/server.nix index 64a8135..dd5d839 100644 --- a/modules/collections/server.nix +++ b/modules/collections/server.nix @@ -31,7 +31,7 @@ ../static-ip.nix ]; - kop = { + custom = { cli-tools.enable = true; tmpfs.enable = true; nix = { diff --git a/modules/graphical/audio.nix b/modules/graphical/audio.nix index 568582b..0431090 100644 --- a/modules/graphical/audio.nix +++ b/modules/graphical/audio.nix @@ -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"; }; diff --git a/modules/graphical/code.nix b/modules/graphical/code.nix index db88ffc..592ac66 100644 --- a/modules/graphical/code.nix +++ b/modules/graphical/code.nix @@ -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"; }; diff --git a/modules/graphical/emulators.nix b/modules/graphical/emulators.nix index 7afe88e..f48abc3 100644 --- a/modules/graphical/emulators.nix +++ b/modules/graphical/emulators.nix @@ -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"; }; diff --git a/modules/graphical/gamemode.nix b/modules/graphical/gamemode.nix index 25241cb..5ab3291 100644 --- a/modules/graphical/gamemode.nix +++ b/modules/graphical/gamemode.nix @@ -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"; }; diff --git a/modules/graphical/games.nix b/modules/graphical/games.nix index d0ef987..e4cbd90 100644 --- a/modules/graphical/games.nix +++ b/modules/graphical/games.nix @@ -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"; }; diff --git a/modules/graphical/gnome.nix b/modules/graphical/gnome.nix index 925c116..7c2e3e7 100644 --- a/modules/graphical/gnome.nix +++ b/modules/graphical/gnome.nix @@ -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"; }; diff --git a/modules/graphical/ime.nix b/modules/graphical/ime.nix index d24d8de..94a2790 100644 --- a/modules/graphical/ime.nix +++ b/modules/graphical/ime.nix @@ -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"; }; diff --git a/modules/graphical/lxqt.nix b/modules/graphical/lxqt.nix index 94909e8..163e371 100644 --- a/modules/graphical/lxqt.nix +++ b/modules/graphical/lxqt.nix @@ -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"; }; diff --git a/modules/graphical/noise-supression.nix b/modules/graphical/noise-supression.nix index d2e3fe7..dfb838d 100644 --- a/modules/graphical/noise-supression.nix +++ b/modules/graphical/noise-supression.nix @@ -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"; }; diff --git a/modules/graphical/obs.nix b/modules/graphical/obs.nix index 5b40f6f..b879008 100644 --- a/modules/graphical/obs.nix +++ b/modules/graphical/obs.nix @@ -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"; }; diff --git a/modules/graphical/openrgb.nix b/modules/graphical/openrgb.nix index c0690c1..eb68eba 100644 --- a/modules/graphical/openrgb.nix +++ b/modules/graphical/openrgb.nix @@ -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"; }; diff --git a/modules/graphical/plasma.nix b/modules/graphical/plasma.nix index 86f36e3..cfaf5ed 100644 --- a/modules/graphical/plasma.nix +++ b/modules/graphical/plasma.nix @@ -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"; }; diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index 10435c0..37f6164 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -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"; }; diff --git a/modules/hardware/firmware.nix b/modules/hardware/firmware.nix index 644974f..1f1bf87 100644 --- a/modules/hardware/firmware.nix +++ b/modules/hardware/firmware.nix @@ -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"; }; diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix index eea135f..cce8848 100644 --- a/modules/hardware/nvidia.nix +++ b/modules/hardware/nvidia.nix @@ -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"; }; diff --git a/modules/hardware/scheduler.nix b/modules/hardware/scheduler.nix index 3bd4f6c..5d65623 100644 --- a/modules/hardware/scheduler.nix +++ b/modules/hardware/scheduler.nix @@ -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"; }; diff --git a/modules/hardware/ssd.nix b/modules/hardware/ssd.nix index 4356350..da8888c 100644 --- a/modules/hardware/ssd.nix +++ b/modules/hardware/ssd.nix @@ -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"; }; diff --git a/modules/hardware/vfio.nix b/modules/hardware/vfio.nix index 06b0ec0..77419f2 100644 --- a/modules/hardware/vfio.nix +++ b/modules/hardware/vfio.nix @@ -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"; }; diff --git a/modules/hardware/wooting.nix b/modules/hardware/wooting.nix index d9b86da..07da869 100644 --- a/modules/hardware/wooting.nix +++ b/modules/hardware/wooting.nix @@ -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"; }; diff --git a/modules/misc/cli-tools.nix b/modules/misc/cli-tools.nix index d45e451..e035b24 100644 --- a/modules/misc/cli-tools.nix +++ b/modules/misc/cli-tools.nix @@ -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"; }; diff --git a/modules/misc/nftables.nix b/modules/misc/nftables.nix index da3cc95..b10d052 100644 --- a/modules/misc/nftables.nix +++ b/modules/misc/nftables.nix @@ -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"; }; diff --git a/modules/misc/tmpfs.nix b/modules/misc/tmpfs.nix index 74d85b3..cd0ca33 100644 --- a/modules/misc/tmpfs.nix +++ b/modules/misc/tmpfs.nix @@ -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"; }; diff --git a/modules/misc/virt-manager.nix b/modules/misc/virt-manager.nix index ae2527f..c436845 100644 --- a/modules/misc/virt-manager.nix +++ b/modules/misc/virt-manager.nix @@ -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"; }; diff --git a/modules/misc/wireshark.nix b/modules/misc/wireshark.nix index b161f5d..6e20d06 100644 --- a/modules/misc/wireshark.nix +++ b/modules/misc/wireshark.nix @@ -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"; }; diff --git a/modules/nix/index.nix b/modules/nix/index.nix index d292168..4aa2941 100644 --- a/modules/nix/index.nix +++ b/modules/nix/index.nix @@ -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"; }; diff --git a/modules/nix/ld.nix b/modules/nix/ld.nix index 8e54f0f..596f6b3 100644 --- a/modules/nix/ld.nix +++ b/modules/nix/ld.nix @@ -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"; }; diff --git a/modules/nix/settings.nix b/modules/nix/settings.nix index dbbe82a..3e74292 100644 --- a/modules/nix/settings.nix +++ b/modules/nix/settings.nix @@ -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"; }; diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix new file mode 100644 index 0000000..a3cc6dd --- /dev/null +++ b/systems/vm/configuration.nix @@ -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; + }; + }; +} diff --git a/users/option.nix b/users/option.nix index 37b5692..bb35200 100644 --- a/users/option.nix +++ b/users/option.nix @@ -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"; + }; }; }; } diff --git a/users/vm/default.nix b/users/vm/default.nix new file mode 100644 index 0000000..e928fdf --- /dev/null +++ b/users/vm/default.nix @@ -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" ]; + }; +} diff --git a/users/vm/home.nix b/users/vm/home.nix new file mode 100644 index 0000000..78621bb --- /dev/null +++ b/users/vm/home.nix @@ -0,0 +1,12 @@ +{ config, pkgs, inputs, ...}: +{ + home = { + stateVersion = "23.05"; + }; + + imports = [ + ../../home-manager/nvim.nix + ../../home-manager/zsh.nix + inputs.nix-colors.homeManagerModule + ]; +}