Regenerated

This commit is contained in:
2026-03-22 17:16:57 +00:00
parent 3de4e8ef79
commit cda6de2bd8
33 changed files with 1557 additions and 1 deletions
@@ -0,0 +1,66 @@
{ lib, pkgs, config, ... }:
let
# Module name
moduleName = "flatpaks";
# Top-level toggle for this module
enableProgram = config.enableFlatpaks or false;
# Path to your Flatpak list
assetPath = ../../../assets/system/apps/flatpaks.conf;
# Resolve user safely
username = config.defaultUser or "henrov";
in
{
# --- Top-level toggle option ---
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
# --- Config only applied if enabled ---
config = lib.mkIf enableProgram {
# Deploy the Flatpak conf file
environment.etc."flatpak/flatpaks.conf".source = assetPath;
# Enable system Flatpak service
services.flatpak.enable = true;
xdg.portal.enable = true;
# Systemd service to install Flatpaks from the list
systemd.services."${moduleName}-sync" = {
description = "Install Flatpak apps listed in flatpaks.conf";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
CONF="${assetPath}"
# Add Flathub if not present
if ! flatpak remotes --system --columns=name | grep -qx flathub; then
flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi
# Install every Flatpak listed in the conf file
while IFS= read -r app || [ -n "$app" ]; do
app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$app" ]; then
if ! flatpak info --system "$app" >/dev/null 2>&1; then
flatpak install --system -y --noninteractive flathub "$app"
fi
fi
done < "$CONF"
'';
};
restartTriggers = [ assetPath ];
# Include only the packages needed for this service
path = [ pkgs.flatpak pkgs.coreutils pkgs.gnugrep pkgs.gnused ];
};
};
}
@@ -0,0 +1,48 @@
{ config, lib, pkgs, flakeRoot, ... }:
let
packagesConfPath = "${flakeRoot}/assets/system/apps/packages.conf";
raw = builtins.readFile packagesConfPath;
# Split lines safely, keep guard against splitting into characters
rawLines = lib.splitString "\n" raw;
_guard =
assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw);
true;
# Clean each line: remove CRs, remove comments, trim
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 path 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
{
nixpkgs.config = { allowUnfree = true; };
environment.systemPackages = packages;
}
@@ -0,0 +1,10 @@
{ config, pkgs, lib, ... }:
{
################################################
# Install Zen Browser system-wide
################################################
environment.systemPackages = [
pkgs.zen-browser
];
}
@@ -0,0 +1,46 @@
{ lib, config, pkgs, inputs, ... }:
let
username = config.defaultUser or "henrov";
# Paths
assetPath = ../../../assets/hyprland/conf/hypr;
mainConfig = "${assetPath}/hyprland.conf";
# Determine Hyprland package with fallbacks
hyprlandPkg =
pkgs.hyprland or
pkgs.hyprland-git or
inputs.hyprland.packages.${pkgs.system}.default;
# Map all files in the asset folder
hyprFiles =
builtins.listToAttrs (
map (f: {
name = ".config/hypr/${f}";
value = { source = "${assetPath}/${f}"; };
}) (builtins.attrNames (builtins.readDir assetPath))
);
in
{
# System-wide package
environment.systemPackages = [ hyprlandPkg ];
# Home Manager user settings
_module.args.hmUsers = {
${username} = {
home.packages = [ hyprlandPkg ];
# Merge main config + all other files
home.file = lib.mkMerge [
hyprFiles
{
".config/hypr/hyprland.conf" = { source = mainConfig; };
}
];
# Optional module-specific settings
settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa";
};
};
}
@@ -0,0 +1,56 @@
{ lib, config, pkgs, ... }:
let
username = config.defaultUser or "henrov";
moduleName = "stylix";
assetPath = ../../../assets/system/conf/${moduleName};
# Read all files in asset directory
programFiles = builtins.readDir assetPath;
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
source = "${assetPath}/${name}";
});
# Read 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 packages
environment.systemPackages = [
pkgs.feh
pkgs.st
];
# Home Manager user settings
_module.args.hmUsers = {
${username} = {
# Copy all stylix config files into ~/.config/stylix/
xdg.configFile =
lib.mapAttrs' (name: value: {
name = "${moduleName}/${name}";
value = { inherit (value) source; };
}) files;
# Session variables
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,34 @@
{ lib, config, pkgs, inputs, ... }:
let
# Default user fallback
username = config.defaultUser or "henrov";
# Safe package reference with flake input fallback
xdgPortalHyprlandPkg = pkgs.xdg-desktop-portal-hyprland or
inputs.xdgPortalHyprland.packages.${pkgs.system}.default;
in
{
# System-wide installation of XDG portal package
environment.systemPackages = [
xdgPortalHyprlandPkg
];
# Home Manager user configuration
_module.args.hmUsers = {
${username} = {
home.packages = [
xdgPortalHyprlandPkg
];
# Enable XDG portal for Hyprland
xdg.portal = {
enable = true;
extraPortals = [ xdgPortalHyprlandPkg ];
config.hyprland = {
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
};
};
};
};
}
@@ -0,0 +1,14 @@
{ pkgs, user, ... } :
{
environment.systemPackages = with pkgs; [
tuigreet
];
services.greetd = {
enable = true;
settings = {
default_session = {
command = pkgs.lib.mkForce "${pkgs.tuigreet}/bin/tuigreet --remember --time --time-format '%I:%M %p | %a %h | %F'";
};
};
};
}
@@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
# (NVF = Neovim/terminal flavor)
stylix.targets.nvf.enable = true;
# feh wallpaper integration
stylix.targets.feh.enable = true;
}
@@ -0,0 +1,36 @@
{ lib, pkgs, config, ... }:
let
username = config.defaultUser or "henrov";
moduleName = "kitty";
# Paths and files
assetPath = ../../../assets/system/conf/${moduleName};
programFiles = builtins.readDir assetPath;
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
in
{
# Install kitty system-wide
environment.systemPackages = [ pkgs.kitty ];
# Home Manager user-specific configuration
_module.args.hmUsers = {
${username} = {
programs.kitty.enable = true;
# Extra user config snippet
programs.kitty.extraConfig = ''
# Include the Catppuccin-Mocha theme
include themes/Catppuccin-Mocha.conf
'';
# Copy all asset files into ~/.config/kitty/
home.file = lib.mkMerge (
map (name: { ".config/${moduleName}/${name}" = { source = files.${name}.src; }; })
(builtins.attrNames files)
);
};
};
}
@@ -0,0 +1,7 @@
{ config, pkgs, lib, flakeRoot, ... }:
{
programs.starship = {
enable = true; # enable Starship integration
};
}
@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
#autocd = true;
#dotDir = "${config.xdg.configHome}/zsh";
oh-my-zsh = {
enable = true;
theme = "";
plugins = [
"git"
"sudo"
"extract"
"colored-man-pages"
"command-not-found"
"history"
"docker"
"kubectl"
];
};
#autosuggestion.enable = true;
syntaxHighlighting.enable = true;
};
}
@@ -0,0 +1,35 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
# Default to the configured default user
username = config.users.users.defaultUser or "henrov";
homeDir = "/home/${username}";
assetPath = "${flakeRoot}/assets/copy_2_home";
in
{
# Ensure rsync is available system-wide
environment.systemPackages = [ pkgs.rsync ];
# System service to copy assets to the user home at boot
systemd.services.copyAssets = {
description = "Copy assets to ${username}'s home directory";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
echo "Copying assets from ${assetPath} to ${homeDir} ..."
if [ ! -d "${assetPath}" ]; then
echo "ERROR: ${assetPath} does not exist"
exit 1
fi
mkdir -p "${homeDir}"
chown ${username}:${username} "${homeDir}"
${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/"
echo "Done copying assets."
'';
};
}
@@ -0,0 +1,26 @@
{ lib, config, pkgs, ... }:
let
username = "henrov";
in
{
# NixOS user
users.users.${username} = {
isNormalUser = true;
home = "/home/${username}";
hashedPassword = "$6$S7iShgBxB.77CwmP$i0njK.2r3OL5UEvgZbmwZ0rnpZ4QyJcv8p9uCmJ4AiVPSMXkQkIwMLzyAOnJ0q8.tPLIp/7EquEIZeK8qbmgw/";
extraGroups = [ "wheel" "networkmanager" ];
};
# Home Manager user definition
_module.args.hmUsers = {
${username} = {
home.username = username;
home.homeDirectory = "/home/${username}";
home.stateVersion = "26.05";
# Example: user packages
home.packages = [ pkgs.git pkgs.vim ];
};
};
}