Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Aug 29, 2024
1 parent cdcb49d commit e3d0f27
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 12 deletions.
54 changes: 54 additions & 0 deletions modules/shared/fonts/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
config,
lib,
pkgs,
namespace,
...
}:
let
inherit (lib) types mkIf;
inherit (lib.${namespace}) mkBoolOpt mkOpt;

cfg = config.${namespace}.system.fonts;
in
{
options.${namespace}.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts =
with pkgs;
mkOpt (listOf package) [
# Desktop Fonts
corefonts # MS fonts
material-icons
material-design-icons
work-sans
comic-neue
source-sans
inter
lexend

# Emojis
noto-fonts-color-emoji
twemoji-color-font

# Nerd Fonts
(nerdfonts.override {
fonts = [
"CascadiaCode"
"Iosevka"
"Monaspace"
"ZedMono"
"NerdFontsSymbolsOnly"
];
})
] "Custom font packages to install.";
default = mkOpt types.str "MonaspiceNe Nerd Font" "Default font name";
};

config = mkIf cfg.enable {
environment.variables = {
# Enable icons in tooling since we have nerdfonts.
LOG_ICONS = "true";
};
};
}
124 changes: 124 additions & 0 deletions modules/shared/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
config,
inputs,
lib,
pkgs,
namespace,
...
}:
let
inherit (lib)
filterAttrs
isType
mapAttrs
mapAttrsToList
mkDefault
mkIf
pipe
types
;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.nix;
in
{
options.${namespace}.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
};

config = mkIf cfg.enable {
# faster rebuilding
documentation = {
doc.enable = false;
info.enable = false;
man.enable = mkDefault true;
};

environment = {
etc = with inputs; {
# set channels (backwards compatibility)
"nix/flake-channels/system".source = self;
"nix/flake-channels/nixpkgs".source = nixpkgs;
"nix/flake-channels/home-manager".source = home-manager;

# preserve current flake in /etc
"nixos/flake".source = self;
};

systemPackages = with pkgs; [
cachix
deploy-rs
git
nix-prefetch-git
];
};

nix =
let
mappedRegistry = pipe inputs [
(filterAttrs (_: isType "flake"))
(mapAttrs (_: flake: { inherit flake; }))
(x: x // { nixpkgs.flake = inputs.nixpkgs; })
];

users = [
"root"
"@wheel"
"nix-builder"
config.${namespace}.user.name
];
in
{
inherit (cfg) package;

gc = {
automatic = true;
options = "--delete-older-than 7d";
};

# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well
nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;

optimise.automatic = true;

# pin the registry to avoid downloading and evaluating a new nixpkgs version every time
# this will add each flake input as a registry to make nix3 commands consistent with your flake
registry = mappedRegistry;

settings = {
allowed-users = users;
auto-optimise-store = true;
builders-use-substitutes = true;
experimental-features = "nix-command flakes";
flake-registry = "/etc/nix/registry.json";
http-connections = 50;
keep-derivations = true;
keep-going = true;
keep-outputs = true;
log-lines = 50;
sandbox = true;
trusted-users = users;
warn-dirty = false;

substituters = [
"https://cache.nixos.org"
"https://elyth.cachix.org"
"https://nix-community.cachix.org"
"https://nixpkgs-unfree.cachix.org"
"https://numtide.cachix.org"
];

trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"elyth.cachix.org-1:cFILLFP7zY7JJKp8WPW9Y6JawMOFb7f6ctoAuXy4j5w="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];

use-xdg-base-directories = true;
};
};
};
}
35 changes: 35 additions & 0 deletions modules/shared/suites/common/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.suites.common;
in
{
options.${namespace}.suites.common = {
enable = mkBoolOpt false "Whether or not to enable common configuration.";
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
coreutils
curl
fd
file
findutils
killall
lsof
pciutils
tldr
unzip
wget
xclip
];
};
}
141 changes: 141 additions & 0 deletions systems/x86_64-linux/grovetender/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib.${namespace}) enabled;
in
{
imports = [
./hardware.nix
];
networking.hostName = "grovetender"; # Define your hostname.

elythnix = {
nix = enabled;

archetypes = {
personal = enabled;
workstation = enabled;
};

display-managers = {
regreet = {
hyprlandOutput = builtins.readFile ./hyprlandOutput;
};
};

hardware = {
audio = {
enable = true;
};
bluetooth = enabled;
cpu.amd = enabled;
gpu = {
amd = enabled;
};
opengl = enabled;

storage = {
enable = true;

ssdEnable = true;
};
};

programs = {
graphical = {
addons = {
noisetorch = {
enable = false;

threshold = 95;
device = "alsa_input.usb-Blue_Microphones_Yeti_Stereo_Microphone_LT_191128065321F39907D0_111000-00.analog-stereo";
deviceUnit = "sys-devices-pci0000:00-0000:00:01.2-0000:02:00.0-0000:03:08.0-0000:08:00.3-usb3-3\x2d2-3\x2d2.1-3\x2d2.1.4-3\x2d2.1.4.3-3\x2d2.1.4.3:1.0-sound-card3-controlC3.device";
};
};

wms = {
hyprland = {
enable = true;
};
};
};
};

services = {
avahi = enabled;
# TODO: input-leap replace barrier
geoclue = enabled;
power = enabled;
printing = enabled;

openssh = {
enable = true;

authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP8Uvx1a/dkacYXKXDikaFL6kfRk+kSj6n7Pwm9t6+HP"
];

# TODO: make part of ssh config proper
extraConfig = ''
Host server
User ${config.${namespace}.user.name}
Hostname elyth.local
'';
};
};

security = {
# doas = enabled;
keyring = enabled;
sudo-rs = enabled;
};

suites = {
development = {
enable = true;
dockerEnable = true;
kubernetesEnable = true;
nixEnable = true;
sqlEnable = true;
};
};

system = {
boot = {
enable = true;
silentBoot = true;
};

fonts = enabled;
locale = enabled;
networking = {
enable = true;
optimizeTcp = true;
};
realtime = enabled;
time = enabled;
};

};

nix.settings = {
cores = 24;
max-jobs = 24;
};

services = {
displayManager.defaultSession = "hyprland";
};

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
14 changes: 14 additions & 0 deletions systems/x86_64-linux/grovetender/hyprlandOutput
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
monitor=HDMI-A-1, 2440x1080@143, 0x0, 2, bitdepth, 10

workspace = name:hello, monitor:DP-1, defafult:true
windowrulev2 = workspace name:hello, class:^(nwg-hello)$

env = CLUTTER_BACKEND,"wayland"
env = HYPRLAND_LOG_WLR,"1"
env = QT_QPA_PLATFORM,"wayland;xcb"
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,"1"
env = SDL_VIDEODRIVER,"wayland"
env = WLR_DRM_NO_ATOMIC,"1"
env = XDG_CURRENT_DESKTOP,"Hyprland"
env = XDG_SESSION_DESKTOP,"Hyprland"
env = XDG_SESSION_TYPE,"wayland"
12 changes: 0 additions & 12 deletions systems/x86_86-linux/grovetender/default.nix

This file was deleted.

0 comments on commit e3d0f27

Please sign in to comment.