to be continued
This commit is contained in:
parent
5490596247
commit
db30ab1fa9
|
@ -1,43 +1,21 @@
|
|||
{
|
||||
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
|
||||
# as well as the libraries available from your flake's inputs.
|
||||
lib
|
||||
, # An instance of `pkgs` with your overlays and packages applied is also available.
|
||||
pkgs
|
||||
, # You also have access to your flake's inputs.
|
||||
inputs
|
||||
, # Additional metadata is provided by Snowfall Lib.
|
||||
home
|
||||
, # The home architecture for this host (eg. `x86_64-linux`).
|
||||
target
|
||||
, # The Snowfall Lib target for this home (eg. `x86_64-home`).
|
||||
format
|
||||
, # A normalized name for the home target (eg. `home`).
|
||||
virtual
|
||||
, # A boolean to determine whether this home is a virtual target using nixos-generators.
|
||||
host
|
||||
, # The host name for this home.
|
||||
# All other arguments come from the home home.
|
||||
config
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib.wyrdgard; {
|
||||
wyrdgard = {
|
||||
user = {
|
||||
enable = true;
|
||||
name = config.snowfallorg.user.name;
|
||||
};
|
||||
# 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 ];
|
||||
|
||||
submodule = {
|
||||
basics.enable = true;
|
||||
graphical-interface.enable = true;
|
||||
};
|
||||
sessionVariables = { EDITOR = "nvim"; };
|
||||
|
||||
system.hardware = {
|
||||
audio.enable = true;
|
||||
bluetooth.enable = true;
|
||||
networking.enable = true;
|
||||
};
|
||||
shellAliases = { vimdiff = "nvim -d"; };
|
||||
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
}
|
||||
|
|
21
modules/nixos/archetypes/gaming/default.nix
Normal file
21
modules/nixos/archetypes/gaming/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ 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.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
wyrdgard.submodules = {
|
||||
basics = enabled;
|
||||
graphical-interface = enabled;
|
||||
games = enabled;
|
||||
socials = enabled;
|
||||
};
|
||||
};
|
||||
}
|
38
modules/nixos/home/default.nix
Normal file
38
modules/nixos/home/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ options
|
||||
, config
|
||||
, pkgs
|
||||
, lib
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.wyrdgard; let
|
||||
cfg = config.wyrdgard.home;
|
||||
in
|
||||
{
|
||||
options.wyrdgard.home = with types; {
|
||||
file =
|
||||
mkOpt attrs { }
|
||||
(mdDoc "A set of files to be managed by home-manager's `home.file`.");
|
||||
configFile =
|
||||
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.";
|
||||
};
|
||||
|
||||
config = {
|
||||
wyrdgard.home.extraOptions = {
|
||||
home.stateVersion = config.system.stateVersion;
|
||||
home.file = mkAliasDefinitions options.wyrdgard.home.file;
|
||||
xdg.enable = true;
|
||||
xdg.configFile = mkAliasDefinitions options.wyrdgard.home.configFile;
|
||||
};
|
||||
|
||||
snowfallorg.user.${config.wyrdgard.user.name}.home.config = config.plusultra.home.extraOptions;
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
};
|
||||
}
|
44
modules/nixos/submodules/basics/default.nix
Normal file
44
modules/nixos/submodules/basics/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.wyrdgard; let
|
||||
cfg = config.wyrdgard.suites.common;
|
||||
in {
|
||||
options.wyrdgard.submodules.basics = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable basic configuration.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
|
||||
];
|
||||
|
||||
wyrdgard = {
|
||||
nix = enabled;
|
||||
|
||||
tools = {
|
||||
git = enabled;
|
||||
nix-ld = enabled;
|
||||
};
|
||||
|
||||
system.hardware = {
|
||||
audio = enabled;
|
||||
bluetooth = enabled;
|
||||
networking = enabled;
|
||||
};
|
||||
|
||||
system = {
|
||||
boot = enabled;
|
||||
fonts = enabled;
|
||||
locale = enabled;
|
||||
time = enabled;
|
||||
xkb = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
20
modules/nixos/tools/direnv/default.nix
Normal file
20
modules/nixos/tools/direnv/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
112
modules/nixos/user/default.nix
Normal file
112
modules/nixos/user/default.nix
Normal file
|
@ -0,0 +1,112 @@
|
|||
{ options
|
||||
, config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.wyrdgard; let
|
||||
cfg = config.wyrdgard.user;
|
||||
defaultIconFileName = "profile.png";
|
||||
defaultIcon = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "default-icon";
|
||||
src = ./. + "/${defaultIconFileName}";
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
cp $src $out
|
||||
'';
|
||||
|
||||
passthru = { fileName = defaultIconFileName; };
|
||||
};
|
||||
propagatedIcon =
|
||||
pkgs.runCommandNoCC "propagated-icon"
|
||||
{ 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
|
||||
{
|
||||
options.wyrdgard.user = with types; {
|
||||
name = mkOpt str "short" "The name to use for the user account.";
|
||||
fullName = mkOpt str "Christoph Hollizeck" "The full name of the user.";
|
||||
email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user.";
|
||||
initialPassword =
|
||||
mkOpt str "asdf"
|
||||
"The initial password to use when the user is first created.";
|
||||
icon =
|
||||
mkOpt (nullOr package) defaultIcon
|
||||
"The profile picture to use for the user.";
|
||||
extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned.";
|
||||
extraOptions =
|
||||
mkOpt attrs { }
|
||||
(mdDoc "Extra options passed to `users.users.<name>`.");
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autosuggestions.enable = true;
|
||||
histFile = "$XDG_CACHE_HOME/zsh.history";
|
||||
};
|
||||
|
||||
wyrdgard.home = {
|
||||
file = {
|
||||
"Desktop/.keep".text = "";
|
||||
"Documents/.keep".text = "";
|
||||
"Downloads/.keep".text = "";
|
||||
"Music/.keep".text = "";
|
||||
"Pictures/.keep".text = "";
|
||||
"Videos/.keep".text = "";
|
||||
"work/.keep".text = "";
|
||||
".face".source = cfg.icon;
|
||||
"Pictures/${
|
||||
cfg.icon.fileName or (builtins.baseNameOf cfg.icon)
|
||||
}".source =
|
||||
cfg.icon;
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
home.shellAliases = {
|
||||
lc = "${pkgs.colorls}/bin/colorls --sd";
|
||||
lcg = "lc --gs";
|
||||
lcl = "lc -1";
|
||||
lclg = "lc -1 --gs";
|
||||
lcu = "${pkgs.colorls}/bin/colorls -U";
|
||||
lclu = "${pkgs.colorls}/bin/colorls -U -1";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${cfg.name} =
|
||||
{
|
||||
isNormalUser = true;
|
||||
|
||||
inherit (cfg) name initialPassword;
|
||||
|
||||
home = "/home/${cfg.name}";
|
||||
group = "users";
|
||||
|
||||
shell = pkgs.zsh;
|
||||
|
||||
# Arbitrary user ID to use for the user. Since I only
|
||||
# have a single user on my machines this won't ever collide.
|
||||
# However, if you add multiple users you'll need to change this
|
||||
# so each user has their own unique uid (or leave it out for the
|
||||
# system to select).
|
||||
uid = 1000;
|
||||
|
||||
extraGroups = [ "steamcmd" ] ++ cfg.extraGroups;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
};
|
||||
}
|
BIN
modules/nixos/user/profile.png
Normal file
BIN
modules/nixos/user/profile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
|
@ -40,6 +40,12 @@
|
|||
xkbVariant = "";
|
||||
};
|
||||
|
||||
wyrdgard = {
|
||||
archetypes = {
|
||||
gaming.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Configure Home-Manager options from NixOS.
|
||||
snowfallorg.user.cholli.home.config = { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue