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,27 +36,25 @@
}; };
}; };
outputs = inputs: outputs = inputs: let
let lib = inputs.snowfall-lib.mkLib {
lib = inputs.snowfall-lib.mkLib { inherit inputs;
inherit inputs; src = ./.;
src = ./.;
snowfall = { snowfall = {
meta = { meta = {
name = "wyrdgard"; name = "wyrdgard";
title = "Wyrdgard"; title = "Wyrdgard";
};
namespace = "wyrdgard";
}; };
namespace = "wyrdgard";
}; };
in };
in
lib.mkFlake { lib.mkFlake {
channels-config = {allowUnfree = true;};
channels-config = { allowUnfree = true; }; outputs-builder = channels: {formatter = channels.nixpkgs.alejandra;};
outputs-builder = channels: { formatter = channels.nixpkgs.nixpkgs-fmt; };
overlays = with inputs; [ overlays = with inputs; [
snowfall-flake.overlays.default snowfall-flake.overlays.default

View file

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

View file

@ -1,5 +1,4 @@
{ lib, ... }: {lib, ...}:
with lib; rec { with lib; rec {
## Create a NixOS module option. ## Create a NixOS module option.
## ##
@ -9,7 +8,7 @@ with lib; rec {
## ##
#@ Type -> Any -> String #@ Type -> Any -> String
mkOpt = type: default: description: mkOpt = type: default: description:
mkOption { inherit type default description; }; mkOption {inherit type default description;};
## Create a NixOS module option without a 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;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.apps.cli-apps.fish; cfg = config.wyrdgard.apps.cli-apps.fish;
in in {
{
options.wyrdgard.apps.cli-apps.fish = with types; { options.wyrdgard.apps.cli-apps.fish = with types; {
enable = mkBoolOpt false "Whether or not to enable the fish shell"; enable = mkBoolOpt false "Whether or not to enable the fish shell";
}; };
@ -11,7 +16,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
fish 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;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.apps._1password; cfg = config.wyrdgard.apps._1password;
in in {
{
options.wyrdgard.apps._1password = with types; { options.wyrdgard.apps._1password = with types; {
enable = mkBoolOpt false "Enable 1Password"; enable = mkBoolOpt false "Enable 1Password";
}; };
@ -13,7 +18,7 @@ in
_1password.enable = true; _1password.enable = true;
_1password-gui = { _1password-gui = {
enable = true; 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;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.apps.discord; cfg = config.wyrdgard.apps.discord;
in in {
{
options.wyrdgard.apps.discord = with types; { options.wyrdgard.apps.discord = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration"; 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; { options.wyrdgard.apps.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable support for Steam."; 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;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.apps.vivaldi; cfg = config.wyrdgard.apps.vivaldi;
in in {
{
options.wyrdgard.apps.vivaldi = with types; { options.wyrdgard.apps.vivaldi = with types; {
enable = mkBoolOpt false "Whether or not to enable vivaldi browser"; 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; { options.wyrdgard.archetypes.gaming = with types; {
enable = mkBoolOpt false "Whether or not to enable the gaming archetype."; enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
}; };

View file

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

View file

@ -1,21 +1,21 @@
{ options {
, config options,
, pkgs config,
, lib pkgs,
, inputs lib,
, ... inputs,
...
}: }:
with lib; with lib;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.nix; cfg = config.wyrdgard.nix;
substituters-submodule = types.submodule ({ name, ... }: { substituters-submodule = types.submodule ({name, ...}: {
options = with types; { options = with types; {
key = mkOpt (nullOr str) null "The trusted public key for this substituter."; key = mkOpt (nullOr str) null "The trusted public key for this substituter.";
}; };
}); });
in in {
{
options.wyrdgard.nix = with types; { options.wyrdgard.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration."; enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt package pkgs.nixUnstable "Which nix package to use."; package = mkOpt package pkgs.nixUnstable "Which nix package to use.";
@ -25,65 +25,63 @@ in
key = mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "The trusted public key for the substituter."; 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 { config = mkIf cfg.enable {
assertions = assertions =
mapAttrsToList mapAttrsToList
(name: value: { (name: value: {
assertion = value.key != null; assertion = value.key != null;
message = "wyrdgard.nix.extra-substituters.${name}.key must be set"; message = "wyrdgard.nix.extra-substituters.${name}.key must be set";
}) })
cfg.extra-substituters; cfg.extra-substituters;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nixfmt nixfmt
nix-prefetch-git nix-prefetch-git
]; ];
nix = nix = let
let users =
users = ["root" config.wyrdgard.user.name]
[ "root" config.wyrdgard.user.name ] ++ optional config.services.hydra.enable "hydra";
++ optional config.services.hydra.enable "hydra"; in {
in package = cfg.package;
{
package = cfg.package;
settings = settings =
{ {
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
http-connections = 50; http-connections = 50;
warn-dirty = false; warn-dirty = false;
log-lines = 50; log-lines = 50;
sandbox = "relaxed"; sandbox = "relaxed";
auto-optimise-store = true; auto-optimise-store = true;
trusted-users = users; trusted-users = users;
allowed-users = users; allowed-users = users;
substituters = substituters =
[ cfg.default-substituter.url ] [cfg.default-substituter.url]
++ (mapAttrsToList (name: value: name) cfg.extra-substituters); ++ (mapAttrsToList (name: value: name) cfg.extra-substituters);
trusted-public-keys = trusted-public-keys =
[ cfg.default-substituter.key ] [cfg.default-substituter.key]
++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters); ++ (mapAttrsToList (name: value: value.key) cfg.extra-substituters);
} }
// (lib.optionalAttrs config.wyrdgard.tools.direnv.enable { // (lib.optionalAttrs config.wyrdgard.tools.direnv.enable {
keep-outputs = true; keep-outputs = true;
keep-derivations = true; keep-derivations = true;
}); });
gc = { gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
};
# flake-utils-plus
generateRegistryFromInputs = true;
generateNixPathFromInputs = true;
linkInputs = true;
}; };
# flake-utils-plus
generateRegistryFromInputs = true;
generateNixPathFromInputs = true;
linkInputs = true;
};
}; };
} }

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; { options.wyrdgard.submodules.basics = with types; {
enable = mkBoolOpt false "Whether or not to enable basic configuration."; 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; { options.wyrdgard.submodules.games = with types; {
enable = mkBoolOpt false "Whether or not you want to enable steam and other games"; enable = mkBoolOpt false "Whether or not you want to enable steam and other games";
}; };
@ -19,7 +23,5 @@ in
steam = enabled; 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; { options.wyrdgard.submodules.graphical-interface = with types; {
enable = mkBoolOpt false "Whether to enable a graphical interface"; enable = mkBoolOpt false "Whether to enable a graphical interface";
}; };
@ -20,5 +23,4 @@ in
desktopManager.plasma5.enable = true; 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; { options.wyrdgard.submodules.socials = with types; {
enable = mkBoolOpt false "Whether to enable social apps"; enable = mkBoolOpt false "Whether to enable social apps";
}; };

View file

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

View file

@ -1,17 +1,17 @@
{ options {
, config options,
, pkgs config,
, lib pkgs,
, ... lib,
...
}: }:
with lib; with lib;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.system.fonts; cfg = config.wyrdgard.system.fonts;
in in {
{
options.wyrdgard.system.fonts = with types; { options.wyrdgard.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts."; 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 { config = mkIf cfg.enable {
@ -26,7 +26,7 @@ in
fonts.packages = with pkgs; fonts.packages = with pkgs;
[ [
(nerdfonts.override { fonts = [ "Jetbrains Mono" "CodeNewRoman" "NerdFontsSymbolsOnly" ]; }) (nerdfonts.override {fonts = ["CodeNewRoman" "NerdFontsSymbolsOnly"];})
font-awesome font-awesome
powerline-fonts powerline-fonts
powerline-symbols 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; { options.wyrdgard.system.hardware.audio = with types; {
enable = mkBoolOpt false "Whether or not to enable audio"; enable = mkBoolOpt false "Whether or not to enable audio";
}; };
@ -26,7 +30,5 @@ in
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = 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; { options.wyrdgard.system.hardware.bluetooth = with types; {
enable = mkBoolOpt false "Whether or not to enable bluetooth"; enable = mkBoolOpt false "Whether or not to enable bluetooth";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
powerOnBoot = 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; { options.wyrdgard.system.hardware.networking = with types; {
enable = mkBoolOpt false "Whether or not to enable networking"; enable = mkBoolOpt false "Whether or not to enable networking";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.networkmanager.enable = true; 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; { options.wyrdgard.system.locale = with types; {
enable = mkBoolOpt false "Whether or not to manage locale settings."; enable = mkBoolOpt false "Whether or not to manage locale settings.";
}; };

View file

@ -1,14 +1,14 @@
{ options {
, config options,
, pkgs config,
, lib pkgs,
, ... lib,
...
}: }:
with lib; with lib;
with lib.wyrdgard; let with lib.wyrdgard; let
cfg = config.wyrdgard.system.time; cfg = config.wyrdgard.system.time;
in in {
{
options.wyrdgard.system.time = with types; { options.wyrdgard.system.time = with types; {
enable = enable =
mkBoolOpt false "Whether or not to configure timezone information."; 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; { options.wyrdgard.system.xkb = with types; {
enable = mkBoolOpt false "Whether or not to configure xkb."; 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; { options.wyrdgard.tools.direnv = with types; {
enable = mkBoolOpt false "Whether or not to enable direnv."; 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;
with lib.wyrdgard; with lib.wyrdgard; let
let
cfg = config.wyrdgard.tools.git; cfg = config.wyrdgard.tools.git;
user = config.wyrdgard.user; user = config.wyrdgard.user;
in in {
{
options.wyrdgard.tools.git = with types; { options.wyrdgard.tools.git = with types; {
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)"; enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
userName = mkOpt types.str user.fullName "The name to use git with"; userName = mkOpt types.str user.fullName "The name to use git with";
@ -24,8 +26,8 @@ in
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
config = { config = {
init = { defaultBranch = "main"; }; init = {defaultBranch = "main";};
push = { autoSetupRemote = true; }; 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; { options.wyrdgard.tools.nix-ld = with types; {
enable = mkBoolOpt false "Wether or not to enable nix-ld"; enable = mkBoolOpt false "Wether or not to enable nix-ld";
}; };

View file

@ -1,8 +1,9 @@
{ options {
, config options,
, pkgs config,
, lib pkgs,
, ... lib,
...
}: }:
with lib; with lib;
with lib.wyrdgard; let with lib.wyrdgard; let
@ -18,38 +19,36 @@ with lib.wyrdgard; let
cp $src $out cp $src $out
''; '';
passthru = { fileName = defaultIconFileName; }; passthru = {fileName = defaultIconFileName;};
}; };
propagatedIcon = propagatedIcon =
pkgs.runCommandNoCC "propagated-icon" pkgs.runCommandNoCC "propagated-icon"
{ passthru = { fileName = cfg.icon.fileName; }; } {passthru = {fileName = cfg.icon.fileName;};}
'' ''
local target="$out/share/wyrdgard-icons/user/${cfg.name}" local target="$out/share/wyrdgard-icons/user/${cfg.name}"
mkdir -p "$target" mkdir -p "$target"
cp ${cfg.icon} "$target/${cfg.icon.fileName}" cp ${cfg.icon} "$target/${cfg.icon.fileName}"
''; '';
in in {
{
options.wyrdgard.user = with types; { options.wyrdgard.user = with types; {
name = mkOpt str "cholli" "The name to use for the user account."; name = mkOpt str "cholli" "The name to use for the user account.";
fullName = mkOpt str "Christoph Hollizeck" "The full name of the user."; fullName = mkOpt str "Christoph Hollizeck" "The full name of the user.";
email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user."; email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user.";
initialPassword = initialPassword =
mkOpt str "asdf" mkOpt str "asdf"
"The initial password to use when the user is first created."; "The initial password to use when the user is first created.";
icon = icon =
mkOpt (nullOr package) defaultIcon mkOpt (nullOr package) defaultIcon
"The profile picture to use for the user."; "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 = extraOptions =
mkOpt attrs { } mkOpt attrs {}
(mdDoc "Extra options passed to `users.users.<name>`."); (mdDoc "Extra options passed to `users.users.<name>`.");
}; };
config = { config = {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
]; ];
programs.zsh = { programs.zsh = {
@ -83,7 +82,6 @@ in
lcu = "${pkgs.colorls}/bin/colorls -U"; lcu = "${pkgs.colorls}/bin/colorls -U";
lclu = "${pkgs.colorls}/bin/colorls -U -1"; lclu = "${pkgs.colorls}/bin/colorls -U -1";
}; };
}; };
}; };
@ -105,7 +103,7 @@ in
# system to select). # system to select).
uid = 1000; uid = 1000;
extraGroups = [ "steamcmd" ] ++ cfg.extraGroups; extraGroups = ["steamcmd"] ++ cfg.extraGroups;
} }
// cfg.extraOptions; // 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"; virtualisation.hypervGuest.videoMode = "1920x1080";
environment.systemPackages = with pkgs; [ 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.EDITOR = "nvim";
environment.variables.SUDOEDITOR = "nvim"; environment.variables.SUDOEDITOR = "nvim";
@ -41,12 +28,13 @@ with lib.wyrdgard;
wyrdgard = { wyrdgard = {
apps = { apps = {
discord = enabled;
vivaldi = enabled; vivaldi = enabled;
}; };
submodules = { submodules = {
basics = enabled; 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 # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config {
, lib config,
, pkgs lib,
, modulesPath pkgs,
, ... modulesPath,
...
}: { }: {
imports = [ ]; imports = [];
boot.initrd.availableKernelModules = [ "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = ["sd_mod" "sr_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ ]; boot.kernelModules = [];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/c58c66b3-4e0f-4393-8d7b-871d934856e3"; device = "/dev/disk/by-uuid/c58c66b3-4e0f-4393-8d7b-871d934856e3";
@ -24,7 +25,7 @@
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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; [ environment.systemPackages = with pkgs; [
fd filelight
tree
ripgrep
]; ];
# nvidia # nvidia
@ -26,9 +28,7 @@ with lib.wyrdgard;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
environment.pathsToLink = [ "/libexec" ]; environment.pathsToLink = ["/libexec"];
services.xserver.videoDrivers = [ "nvidia" ];
wyrdgard = { wyrdgard = {
archetypes = { 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. # Configure Home-Manager options from NixOS.
snowfallorg.user.cholli.home.config = { snowfallorg.user.cholli.home.config = {
programs.kitty = { programs.kitty = {

View file

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