live run of hypr on fwdesk

This commit is contained in:
ari committed 2026-09-05 14:01:38 -04:00
1 parent 787b785582
commit 8dae12d16b
21 files changed
+454 -11

No files matched your search

+1
View File
@@ -29,6 +29,7 @@ All custom options live under `skyg.*`. Never introduce options outside this nam
```
skyg.user.* → core/user.nix
skyg.networkDrives.* → network-drives.nix
skyg.rootDir → core/default.nix (set by the flake; repo root store path)
skyg.nixos.common.* → nixos/common/
skyg.nixos.desktop.* → nixos/desktop/
skyg.nixos.server.* → nixos/server/
+7 -5
View File
@@ -1,15 +1,17 @@
{ ... }:
{ lib, ... }:
{
imports = [
./user.nix
./macos.nix
./nix-substituters.nix
];
options = {
skyg.rootDir = lib.mkOption {
type = lib.types.path;
description = "Top-level path of the nixos-setup repo (set by the flake).";
};
};
config = {
# Workaround: pipx 1.8.0 test suite fails in nixpkgs 26.05 due to a whitespace
# normalization regression in PEP 508 URL specifiers (space before @ in URLs).
# Must use pythonPackagesExtensions to patch the python3Packages.pipx that
# the build system actually uses, not just the top-level pkgs.pipx wrapper.
nixpkgs.overlays = [
(final: _prev: {
# xAI Grok CLI — prebuilt binary, see pkgs/grok-cli.
+5
View File
@@ -1,6 +1,7 @@
{ nixpkgs
, nixpkgs-unstable
, user
, rootDir
, determinate
, home-manager
, nix-darwin
@@ -101,6 +102,7 @@ in
(import ./main.nix {
inherit
user
rootDir
hostName
systemStateVersion;
})
@@ -124,6 +126,7 @@ in
(import ./main.nix {
inherit
user
rootDir
hostName
systemStateVersion
homeManagerVersion
@@ -149,6 +152,7 @@ in
(import ./main.nix {
inherit
user
rootDir
hostName
systemStateVersion
homeManagerVersion
@@ -184,6 +188,7 @@ in
(import ./main.nix {
inherit
user
rootDir
homeManagerVersion
hostName
systemStateVersion;
+2
View File
@@ -1,6 +1,7 @@
{ user
, systemStateVersion
, hostName
, rootDir
, ...
}:
{ lib, ... }: {
@@ -15,6 +16,7 @@
fullName = lib.mkDefault user.fullName;
email = lib.mkDefault user.email;
};
skyg.rootDir = rootDir;
skyg.core.hostName = hostName;
skyg.home-manager.version = lib.mkDefault "26.05";
system.stateVersion = systemStateVersion;
+32 -2
View File
@@ -12,6 +12,21 @@ let
hyprlandPkg = hyprland.packages.${system}.hyprland;
hyprlandPortal = hyprland.packages.${system}.xdg-desktop-portal-hyprland;
noctaliaPkg = noctalia.packages.${system}.default;
# When mountAsSource is set, build a real, GC-protected copy of the hypr config
# dir. The flake self-source path (skyg.rootDir) is not referenced by the system
# closure, so it gets garbage-collected and the ~/.config/hypr symlink dangles.
# This derivation is added to the system profile, pinning it against GC.
bakedHyprConfig = pkgs.stdenv.mkDerivation {
pname = "${cfg.configName}-hypr-config";
version = "1";
src = "${config.skyg.rootDir}/configs/${cfg.configName}/hypr";
buildPhase = "true";
installPhase = ''
mkdir -p "$out/${cfg.configName}"
cp -r "$src" "$out/${cfg.configName}/hypr"
'';
};
in
{
options = {
@@ -35,6 +50,17 @@ in
Disable on hosts that manage their own Hyprland config elsewhere.
'';
};
mountAsSource = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
If `configLink.enable` is true, embed the config dir in the build.
A GC-protected copy of the config is baked into the system closure
(via a derivation added to the system profile) instead of symlinking
to the live `~/nixos-setup/configs` checkout, making the config part
of the built system and reproducible.
'';
};
};
};
};
@@ -65,14 +91,18 @@ in
grim
slurp
satty
];
] ++ (lib.optionals cfg.configLink.mountAsSource [ bakedHyprConfig ]);
# Symlink ~/.config/hypr -> configs/<configName>/hypr (host-specific).
system.userActivationScripts.hyprlandConfig = lib.mkIf cfg.configLink.enable {
text = skygUtils.makeHyperlinkScriptToConfigs {
filePath = "${cfg.configName}/hypr";
targetPath = "hypr";
configSource = "/home/${config.skyg.user.name}/nixos-setup/configs";
configSource =
if cfg.configLink.mountAsSource then
"${bakedHyprConfig}"
else
"/home/${config.skyg.user.name}/nixos-setup/configs";
};
};
};