build(flake.lock, flake.nix): optimise flake inputs

This commit is contained in:
Mohammad Rafiq 2025-07-02 02:29:46 +08:00
parent cb0923601b
commit fd19ac2c9d
No known key found for this signature in database
3 changed files with 394 additions and 589 deletions

885
flake.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,59 +7,35 @@
snowfall.namespace = "pantheon"; snowfall.namespace = "pantheon";
}; };
inputs = { inputs = {
crane.url = "github:ipetkov/crane"; # We use nixos-unstable as everything is cached.
rrv-sh.url = "github:rrvsh/rrv.sh";
disko.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
flake-compat.url = "github:edolstra/flake-compat";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-utils-plus.inputs.flake-utils.follows = "flake-utils";
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
flake-utils.inputs.systems.follows = "systems";
flake-utils.url = "github:numtide/flake-utils";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
hyprland.url = "github:hyprwm/Hyprland";
impermanence.url = "github:nix-community/impermanence";
import-tree.url = "github:vic/import-tree";
mnw.url = "github:Gerg-L/mnw";
nil.inputs.nixpkgs.follows = "nixpkgs";
nil.url = "github:oxalica/nil";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.inputs.flake-parts.follows = "flake-parts"; # My fork for random shit
nur.inputs.nixpkgs.follows = "nixpkgs";
nur.url = "github:nix-community/NUR";
nvf.inputs.flake-parts.follows = "flake-parts";
nvf.inputs.flake-utils.follows = "flake-utils";
nvf.inputs.mnw.follows = "mnw";
nvf.inputs.nil.follows = "nil";
nvf.inputs.nixpkgs.follows = "nixpkgs";
nvf.inputs.systems.follows = "systems";
nvf.url = "github:rrvsh/nvf/uv-nvim";
python-flexseal.inputs.flake-utils.follows = "flake-utils";
python-flexseal.inputs.nixpkgs.follows = "nixpkgs";
python-flexseal.url = "github:Janrupf/python-flexseal";
rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module"; rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay"; # import-tree lets us use less imports = []
snowfall-lib.inputs.flake-compat.follows = "flake-compat"; import-tree.url = "github:vic/import-tree";
snowfall-lib.inputs.flake-utils-plus.follows = "flake-utils-plus";
snowfall-lib.inputs.nixpkgs.follows = "nixpkgs"; # The following are used for less boilerplate.
snowfall-lib.url = "github:snowfallorg/lib"; flake-parts.url = "github:hercules-ci/flake-parts";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
# Various nix things
nur.url = "github:nix-community/NUR";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
stable-diffusion-webui-nix.inputs.flake-utils.follows = "flake-utils"; disko.url = "github:nix-community/disko";
stable-diffusion-webui-nix.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager";
stable-diffusion-webui-nix.inputs.python-flexseal.follows = "python-flexseal"; impermanence.url = "github:nix-community/impermanence";
stable-diffusion-webui-nix.url = "github:janrupf/stable-diffusion-webui-nix"; nix-index-database.url = "github:nix-community/nix-index-database";
stylix.url = "github:nix-community/stylix"; stylix.url = "github:nix-community/stylix";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
zjstatus.inputs.crane.follows = "crane";
zjstatus.inputs.flake-utils.follows = "flake-utils"; # Packages and services that we don't use nixpkgs for.
zjstatus.inputs.nixpkgs.follows = "nixpkgs"; rrv-sh.url = "github:rrvsh/rrv.sh";
zjstatus.inputs.rust-overlay.follows = "rust-overlay"; nvf.url = "github:rrvsh/nvf/uv-nvim";
stable-diffusion-webui-nix.url = "github:janrupf/stable-diffusion-webui-nix";
zjstatus.url = "github:dj95/zjstatus"; zjstatus.url = "github:dj95/zjstatus";
}; };
} }

View file

@ -1,27 +1,16 @@
{ { config, lib, ... }:
config,
lib,
inputs,
system,
...
}:
let let
inherit (lib) mkEnableOption mkIf singleton; inherit (lib) mkEnableOption mkIf singleton;
inherit (config.desktop) mainMonitor; inherit (config.desktop) mainMonitor;
cfg = config.desktop.window-manager.hyprland; cfg = config.desktop.window-manager.hyprland;
in in
{ {
options.desktop.window-manager.hyprland = { options.desktop.window-manager.hyprland.enable = mkEnableOption "";
enable = mkEnableOption "";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
nix.settings = { # Enable custom module for wayland utilities (clipboard etc.)
substituters = [ "https://hyprland.cachix.org" ];
trusted-substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
desktop.enableWaylandUtilities = true; desktop.enableWaylandUtilities = true;
# Start Hyprland at boot only if not connecting through SSH
environment.loginShellInit = # sh environment.loginShellInit = # sh
'' ''
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
@ -31,24 +20,27 @@ in
fi fi
''; '';
environment.variables = { environment.variables = {
# Get Electron apps to use Wayland
ELECTRON_OZONE_PLATFORM_HINT = "auto"; ELECTRON_OZONE_PLATFORM_HINT = "auto";
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
}; };
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
# Use UWSM to have each process controlled by systemd init
withUWSM = true; withUWSM = true;
package = inputs.hyprland.packages.${system}.hyprland;
portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland;
}; };
home-manager.sharedModules = singleton { home-manager.sharedModules = singleton {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
# This is needed for UWSM
systemd.enable = false; systemd.enable = false;
# Null the packages since we use them system wide
package = null; package = null;
portalPackage = null; portalPackage = null;
}; };
xdg.configFile."uwsm/env".text = # sh xdg.configFile."uwsm/env".text = # sh
'' ''
# Force apps to scale right with Wayland
export GDK_SCALE=${mainMonitor.scale} export GDK_SCALE=${mainMonitor.scale}
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale} export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
''; '';