Regenerated
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
#################################
|
||||
# Read package list from config file
|
||||
#################################
|
||||
packagesConfPath = "${flakeRoot}/assets/system/apps/packages.conf";
|
||||
raw = builtins.readFile packagesConfPath;
|
||||
|
||||
rawLines = lib.splitString "\n" raw;
|
||||
|
||||
# Guard against splitting into characters accidentally
|
||||
_guard = assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); true;
|
||||
|
||||
# Clean each line: remove CRs, comments, trim whitespace
|
||||
cleanLine = line:
|
||||
let
|
||||
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
|
||||
noInlineComment = lib.head (lib.splitString "#" noCR);
|
||||
in
|
||||
lib.strings.trim noInlineComment;
|
||||
|
||||
# Filter out empty lines
|
||||
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
|
||||
|
||||
# Resolve attribute paths in pkgs
|
||||
resolvePkg = name:
|
||||
let
|
||||
parts = lib.splitString "." name;
|
||||
found = lib.attrByPath parts null pkgs;
|
||||
in
|
||||
if found == null then
|
||||
throw ''
|
||||
packages.nix: package not found in pkgs
|
||||
Token : ${builtins.toJSON name}
|
||||
packages.conf : ${packagesConfPath}
|
||||
Hint : check the attribute name on search.nixos.org/packages
|
||||
'';
|
||||
else
|
||||
found;
|
||||
|
||||
# Final system-wide package list
|
||||
packages = builtins.seq _guard (map resolvePkg entries);
|
||||
|
||||
in {
|
||||
#################################
|
||||
# Allow unfree packages globally
|
||||
#################################
|
||||
nixpkgs.config = { allowUnfree = true; };
|
||||
|
||||
#################################
|
||||
# System packages
|
||||
#################################
|
||||
environment.systemPackages = packages;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
assetPath = "${flakeRoot}/assets/hyprland/conf";
|
||||
|
||||
# Read all files in the asset directory
|
||||
assetFiles = builtins.attrNames (builtins.readDir assetPath);
|
||||
|
||||
# Convert files to Home Manager xdg config entries
|
||||
hyprFiles = lib.genAttrs assetFiles (f: {
|
||||
# Destination path in home directory
|
||||
name = ".config/hypr/${f}";
|
||||
# Source file path
|
||||
value = { source = "${assetPath}/${f}"; };
|
||||
});
|
||||
|
||||
# Determine Hyprland package
|
||||
hyprlandPkg =
|
||||
pkgs.hyprland or
|
||||
pkgs.hyprland-git or
|
||||
inputs.hyprland.packages.${pkgs.system}.default;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [ hyprlandPkg ];
|
||||
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
home.packages = [ hyprlandPkg ];
|
||||
|
||||
# Merge all files in the asset folder into ~/.config/hypr/
|
||||
home.file = lib.mkMerge hyprFiles;
|
||||
|
||||
# Optional: Hyprland settings
|
||||
settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# Determine the default username from host config
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
moduleName = "stylix";
|
||||
assetPath = "${flakeRoot}/assets/system/conf/${moduleName}";
|
||||
|
||||
# Read all files in the asset directory
|
||||
programFiles = builtins.readDir assetPath;
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
source = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Optional stylix.conf
|
||||
stylixConfFile = "${assetPath}/stylix.conf";
|
||||
stylixConf =
|
||||
if builtins.pathExists stylixConfFile
|
||||
then builtins.readFile stylixConfFile
|
||||
else "";
|
||||
|
||||
# Cursor defaults
|
||||
cursorName = "phinger-cursors-light";
|
||||
cursorSize = 24;
|
||||
in
|
||||
{
|
||||
############################
|
||||
# System-level packages
|
||||
############################
|
||||
environment.systemPackages = [
|
||||
pkgs.feh
|
||||
pkgs.st
|
||||
];
|
||||
|
||||
############################
|
||||
# Home Manager user config
|
||||
############################
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
|
||||
# Map all config files into ~/.config/stylix/
|
||||
xdg.configFile =
|
||||
lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value = { inherit (value) source; };
|
||||
}) files;
|
||||
|
||||
# Environment variables for the session
|
||||
home.sessionVariables = {
|
||||
STYLIX_CONF = "$HOME/.config/stylix/stylix.conf";
|
||||
|
||||
XCURSOR_THEME = cursorName;
|
||||
XCURSOR_SIZE = toString cursorSize;
|
||||
HYPRCURSOR_THEME = cursorName;
|
||||
HYPRCURSOR_SIZE = toString cursorSize;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
#################################
|
||||
# Core Wayland packages
|
||||
#################################
|
||||
environment.systemPackages = with pkgs; [
|
||||
wayland
|
||||
wl-clipboard # optional but commonly used for copy/paste
|
||||
];
|
||||
|
||||
#################################
|
||||
# Optional: enable graphics stack
|
||||
#################################
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
#################################
|
||||
# Optional session variables for Wayland
|
||||
#################################
|
||||
environment.sessionVariables = {
|
||||
# Forces some apps to use Wayland
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
download-buffer-size = 536870912; # 512 MB
|
||||
cores = 2;
|
||||
max-jobs = 1;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user