adjusted workvm configuration

This commit is contained in:
christoph.hollizeck 2024-03-26 22:05:03 +01:00
parent 16770c5d67
commit 69e1940191
36 changed files with 466 additions and 326 deletions

View file

@ -36,8 +36,7 @@
};
};
outputs = inputs:
let
outputs = inputs: let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
@ -53,10 +52,9 @@
};
in
lib.mkFlake {
channels-config = {allowUnfree = true;};
channels-config = { allowUnfree = true; };
outputs-builder = channels: { formatter = channels.nixpkgs.nixpkgs-fmt; };
outputs-builder = channels: {formatter = channels.nixpkgs.alejandra;};
overlays = with inputs; [
snowfall-flake.overlays.default

View file

@ -1,18 +1,18 @@
{ lib
, pkgs
, config
, ...
{
lib,
pkgs,
config,
...
}:
# User information gathered by Snowfall Lib is available.
let
name = config.snowfallorg.user.name;
home = config.snowfallorg.user.home.directory;
in
{
in {
home = {
packages = with pkgs; [ neovim ];
packages = with pkgs; [neovim];
sessionVariables = { EDITOR = "nvim"; };
sessionVariables = {EDITOR = "nvim";};
shellAliases = {
vim = "nvim";

View file

@ -1,21 +1,21 @@
{ lib
, pkgs
, config
, ...
}:
# User information gathered by Snowfall Lib is available.
let
name = config.snowfallorg.user.name;
home = config.snowfallorg.user.home.directory;
in
{
home = {
packages = with pkgs; [ neovim firefox ];
lib,
pkgs,
config,
osConfig ? {},
format ? "unknown",
...
}:
with lib.wyrdgard; {
wyrdgard = {
apps.cli-apps = {
fish = enabled;
home-manager = enabled;
};
sessionVariables = { EDITOR = "nvim"; };
shellAliases = { vimdiff = "nvim -d"; };
stateVersion = "23.11";
tools = {
git = enabled;
direnv = enabled;
};
};
}

View file

@ -1,5 +1,4 @@
{ lib, ... }:
{lib, ...}:
with lib; rec {
## Create a NixOS module option.
##
@ -9,7 +8,7 @@ with lib; rec {
##
#@ Type -> Any -> String
mkOpt = type: default: description:
mkOption { inherit type default description; };
mkOption {inherit type default description;};
## Create a NixOS module option without a description.
##

View file

@ -1,9 +1,14 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.apps.cli-apps.fish;
in
{
in {
options.wyrdgard.apps.cli-apps.fish = with types; {
enable = mkBoolOpt false "Whether or not to enable the fish shell";
};
@ -11,7 +16,8 @@ in
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
fish
fishPlugins.tide
starship
colorls
];
};
}

View file

@ -0,0 +1,18 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
inherit (lib.wyrdgard) enabled;
cfg = config.wyrdgard.apps.cli-apps.home-manager;
in {
options.wyrdgard.apps.cli-apps.home-manager = {
enable = mkEnableOption "home-manager";
};
config = mkIf cfg.enable {
programs.home-manager = enabled;
};
}

View file

@ -0,0 +1,24 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.direnv;
in {
options.wyrdgard.tools.direnv = with types; {
enable = mkBoolOpt false "Whether or not to enable direnv.";
};
config = mkIf cfg.enable {
wyrdgard.home.extraOptions = {
programs.direnv = {
enable = true;
nix-direnv = enabled;
};
};
};
}

View file

@ -0,0 +1,34 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.git;
user = config.wyrdgard.user;
in {
options.wyrdgard.tools.git = with types; {
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
userName = mkOpt types.str user.fullName "The name to use git with";
userEmail = mkOpt types.str user.email "The email to use git with";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
git
gitAndTools.gh
];
programs.git = {
enable = true;
lfs.enable = true;
config = {
init = {defaultBranch = "main";};
push = {autoSetupRemote = true;};
};
};
};
}

View file

@ -0,0 +1,19 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.nix-ld;
in {
options.wyrdgard.tools.nix-ld = with types; {
enable = mkBoolOpt false "Wether or not to enable nix-ld";
};
config = mkIf cfg.enable {
programs.nix-ld.enable = true;
};
}

View file

@ -1,9 +1,14 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.apps._1password;
in
{
in {
options.wyrdgard.apps._1password = with types; {
enable = mkBoolOpt false "Enable 1Password";
};
@ -13,7 +18,7 @@ in
_1password.enable = true;
_1password-gui = {
enable = true;
polkitPolicyOwners = [ config.wyrdgard.user.name ];
polkitPolicyOwners = [config.wyrdgard.user.name];
};
};
};

View file

@ -1,9 +1,14 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.apps.discord;
in
{
in {
options.wyrdgard.apps.discord = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration";
};

View file

@ -1,11 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.apps.steam;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.apps.steam;
in {
options.wyrdgard.apps.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable support for Steam.";
};

View file

@ -1,9 +1,14 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.apps.vivaldi;
in
{
in {
options.wyrdgard.apps.vivaldi = with types; {
enable = mkBoolOpt false "Whether or not to enable vivaldi browser";
};

View file

@ -1,11 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.archetypes.gaming;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.archetypes.gaming;
in {
options.wyrdgard.archetypes.gaming = with types; {
enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
};

View file

@ -1,23 +1,23 @@
{ options
, config
, pkgs
, lib
, inputs
, ...
{
options,
config,
pkgs,
lib,
inputs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.home;
in
{
in {
options.wyrdgard.home = with types; {
file =
mkOpt attrs { }
mkOpt attrs {}
(mdDoc "A set of files to be managed by home-manager's `home.file`.");
configFile =
mkOpt attrs { }
mkOpt attrs {}
(mdDoc "A set of files to be managed by home-manager's `xdg.configFile`.");
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
extraOptions = mkOpt attrs {} "Options to pass directly to home-manager.";
};
config = {

View file

@ -1,21 +1,21 @@
{ options
, config
, pkgs
, lib
, inputs
, ...
{
options,
config,
pkgs,
lib,
inputs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.nix;
substituters-submodule = types.submodule ({ name, ... }: {
substituters-submodule = types.submodule ({name, ...}: {
options = with types; {
key = mkOpt (nullOr str) null "The trusted public key for this substituter.";
};
});
in
{
in {
options.wyrdgard.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt package pkgs.nixUnstable "Which nix package to use.";
@ -25,7 +25,7 @@ in
key = mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "The trusted public key for the substituter.";
};
extra-substituters = mkOpt (attrsOf substituters-submodule) { } "Extra substituters to configure.";
extra-substituters = mkOpt (attrsOf substituters-submodule) {} "Extra substituters to configure.";
};
config = mkIf cfg.enable {
@ -42,13 +42,11 @@ in
nix-prefetch-git
];
nix =
let
nix = let
users =
[ "root" config.wyrdgard.user.name ]
["root" config.wyrdgard.user.name]
++ optional config.services.hydra.enable "hydra";
in
{
in {
package = cfg.package;
settings =
@ -63,10 +61,10 @@ in
allowed-users = users;
substituters =
[ cfg.default-substituter.url ]
[cfg.default-substituter.url]
++ (mapAttrsToList (name: value: name) cfg.extra-substituters);
trusted-public-keys =
[ cfg.default-substituter.key ]
[cfg.default-substituter.key]
++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters);
}
// (lib.optionalAttrs config.wyrdgard.tools.direnv.enable {

View file

@ -1,10 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.submodules.basics;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.submodules.basics;
in {
options.wyrdgard.submodules.basics = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration.";
};

View file

@ -1,10 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.submodules.games;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.submodules.games;
in {
options.wyrdgard.submodules.games = with types; {
enable = mkBoolOpt false "Whether or not you want to enable steam and other games";
};
@ -19,7 +23,5 @@ in
steam = enabled;
};
};
};
}

View file

@ -1,11 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.submodules.graphical-interface;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.submodules.graphical-interface;
in {
options.wyrdgard.submodules.graphical-interface = with types; {
enable = mkBoolOpt false "Whether to enable a graphical interface";
};
@ -20,5 +23,4 @@ in
desktopManager.plasma5.enable = true;
};
};
}

View file

@ -1,11 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.submodules.socials;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.submodules.socials;
in {
options.wyrdgard.submodules.socials = with types; {
enable = mkBoolOpt false "Whether to enable social apps";
};

View file

@ -1,14 +1,14 @@
{ options
, config
, pkgs
, lib
, ...
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.boot;
in
{
in {
options.wyrdgard.system.boot = with types; {
enable = mkBoolOpt false "Whether or not to enable booting.";
};

View file

@ -1,17 +1,17 @@
{ options
, config
, pkgs
, lib
, ...
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.fonts;
in
{
in {
options.wyrdgard.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
fonts = mkOpt (listOf package) [] "Custom font packages to install.";
};
config = mkIf cfg.enable {
@ -26,7 +26,7 @@ in
fonts.packages = with pkgs;
[
(nerdfonts.override { fonts = [ "Jetbrains Mono" "CodeNewRoman" "NerdFontsSymbolsOnly" ]; })
(nerdfonts.override {fonts = ["CodeNewRoman" "NerdFontsSymbolsOnly"];})
font-awesome
powerline-fonts
powerline-symbols

View file

@ -1,10 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.hardware.audio;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.hardware.audio;
in {
options.wyrdgard.system.hardware.audio = with types; {
enable = mkBoolOpt false "Whether or not to enable audio";
};
@ -26,7 +30,5 @@ in
alsa.support32Bit = true;
pulse.enable = true;
};
};
}

View file

@ -1,17 +1,19 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.hardware.bluetooth;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.hardware.bluetooth;
in {
options.wyrdgard.system.hardware.bluetooth = with types; {
enable = mkBoolOpt false "Whether or not to enable bluetooth";
};
config = mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;

View file

@ -1,17 +1,19 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.hardware.networking;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.hardware.networking;
in {
options.wyrdgard.system.hardware.networking = with types; {
enable = mkBoolOpt false "Whether or not to enable networking";
};
config = mkIf cfg.enable {
networking.networkmanager.enable = true;
};
}

View file

@ -1,10 +1,14 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.locale;
in
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.locale;
in {
options.wyrdgard.system.locale = with types; {
enable = mkBoolOpt false "Whether or not to manage locale settings.";
};

View file

@ -1,14 +1,14 @@
{ options
, config
, pkgs
, lib
, ...
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.time;
in
{
in {
options.wyrdgard.system.time = with types; {
enable =
mkBoolOpt false "Whether or not to configure timezone information.";

View file

@ -1,10 +1,13 @@
{ options, config, lib, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.system.xkb;
in
{
options,
config,
lib,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.system.xkb;
in {
options.wyrdgard.system.xkb = with types; {
enable = mkBoolOpt false "Whether or not to configure xkb.";
};

View file

@ -1,10 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let cfg = config.wyrdgard.tools.direnv;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.direnv;
in {
options.wyrdgard.tools.direnv = with types; {
enable = mkBoolOpt false "Whether or not to enable direnv.";
};

View file

@ -1,13 +1,15 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.git;
user = config.wyrdgard.user;
in
{
in {
options.wyrdgard.tools.git = with types; {
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
userName = mkOpt types.str user.fullName "The name to use git with";
@ -24,8 +26,8 @@ in
enable = true;
lfs.enable = true;
config = {
init = { defaultBranch = "main"; };
push = { autoSetupRemote = true; };
init = {defaultBranch = "main";};
push = {autoSetupRemote = true;};
};
};
};

View file

@ -1,12 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.tools.nix-ld;
in
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard; let
cfg = config.wyrdgard.tools.nix-ld;
in {
options.wyrdgard.tools.nix-ld = with types; {
enable = mkBoolOpt false "Wether or not to enable nix-ld";
};

View file

@ -1,8 +1,9 @@
{ options
, config
, pkgs
, lib
, ...
{
options,
config,
pkgs,
lib,
...
}:
with lib;
with lib.wyrdgard; let
@ -18,19 +19,18 @@ with lib.wyrdgard; let
cp $src $out
'';
passthru = { fileName = defaultIconFileName; };
passthru = {fileName = defaultIconFileName;};
};
propagatedIcon =
pkgs.runCommandNoCC "propagated-icon"
{ passthru = { fileName = cfg.icon.fileName; }; }
{passthru = {fileName = cfg.icon.fileName;};}
''
local target="$out/share/wyrdgard-icons/user/${cfg.name}"
mkdir -p "$target"
cp ${cfg.icon} "$target/${cfg.icon.fileName}"
'';
in
{
in {
options.wyrdgard.user = with types; {
name = mkOpt str "cholli" "The name to use for the user account.";
fullName = mkOpt str "Christoph Hollizeck" "The full name of the user.";
@ -41,15 +41,14 @@ in
icon =
mkOpt (nullOr package) defaultIcon
"The profile picture to use for the user.";
extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned.";
extraGroups = mkOpt (listOf str) [] "Groups for the user to be assigned.";
extraOptions =
mkOpt attrs { }
mkOpt attrs {}
(mdDoc "Extra options passed to `users.users.<name>`.");
};
config = {
environment.systemPackages = with pkgs; [
];
programs.zsh = {
@ -83,7 +82,6 @@ in
lcu = "${pkgs.colorls}/bin/colorls -U";
lclu = "${pkgs.colorls}/bin/colorls -U -1";
};
};
};
@ -105,7 +103,7 @@ in
# system to select).
uid = 1000;
extraGroups = [ "steamcmd" ] ++ cfg.extraGroups;
extraGroups = ["steamcmd"] ++ cfg.extraGroups;
}
// cfg.extraOptions;
};

View file

@ -1,33 +1,20 @@
{ pkgs, config, lib, ... }:
with lib;
with lib.wyrdgard;
{
imports = [ ./hardware.nix ];
pkgs,
config,
lib,
...
}:
with lib;
with lib.wyrdgard; {
imports = [./hardware.nix];
boot.blacklistedKernelModules = [ "hyperv-fb" ];
boot.blacklistedKernelModules = ["hyperv-fb"];
virtualisation.hypervGuest.videoMode = "1920x1080";
environment.systemPackages = with pkgs; [
kitty
fish
fishPlugins.tide
fd
tree
ripgrep
];
services.xserver = {
enable = true;
displayManager.sddm = {
enable = true;
wayland.enable = true;
};
desktopManager.plasma5.enable = true;
layout = "us";
xkbVariant = "";
};
environment.variables.EDITOR = "nvim";
environment.variables.SUDOEDITOR = "nvim";
@ -41,12 +28,13 @@ with lib.wyrdgard;
wyrdgard = {
apps = {
discord = enabled;
vivaldi = enabled;
};
submodules = {
basics = enabled;
graphical-interface = enabled;
socials = enabled;
};
};

View file

@ -1,18 +1,19 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config
, lib
, pkgs
, modulesPath
, ...
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [ ];
imports = [];
boot.initrd.availableKernelModules = [ "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/c58c66b3-4e0f-4393-8d7b-871d934856e3";
@ -24,7 +25,7 @@
fsType = "vfat";
};
swapDevices = [ ];
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,13 +1,15 @@
{ pkgs, config, lib, ... }:
with lib;
with lib.wyrdgard;
{
imports = [ ./hardware.nix ];
pkgs,
config,
lib,
...
}:
with lib;
with lib.wyrdgard; {
imports = [./hardware.nix];
environment.systemPackages = with pkgs; [
fd
tree
ripgrep
filelight
];
# nvidia
@ -26,9 +28,7 @@ with lib.wyrdgard;
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
environment.pathsToLink = [ "/libexec" ];
services.xserver.videoDrivers = [ "nvidia" ];
environment.pathsToLink = ["/libexec"];
wyrdgard = {
archetypes = {
@ -45,6 +45,9 @@ with lib.wyrdgard;
};
};
services.xserver.videoDrivers = ["nvidia"];
services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false;
# Configure Home-Manager options from NixOS.
snowfallorg.user.cholli.home.config = {
programs.kitty = {

View file

@ -1,20 +1,21 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config
, lib
, pkgs
, modulesPath
, ...
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/444a9216-59d1-46e0-9643-0b716a42ba0b";
@ -26,7 +27,7 @@
fsType = "vfat";
};
swapDevices = [ ];
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's