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";
};
inputs = {
crane.url = "github:ipetkov/crane";
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";
# We use nixos-unstable as everything is cached.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.inputs.flake-parts.follows = "flake-parts";
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";
# My fork for random shit
rrvsh-nixpkgs.url = "github:rrvsh/nixpkgs/librechat-module";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
snowfall-lib.inputs.flake-compat.follows = "flake-compat";
snowfall-lib.inputs.flake-utils-plus.follows = "flake-utils-plus";
snowfall-lib.inputs.nixpkgs.follows = "nixpkgs";
snowfall-lib.url = "github:snowfallorg/lib";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# import-tree lets us use less imports = []
import-tree.url = "github:vic/import-tree";
# The following are used for less boilerplate.
flake-parts.url = "github:hercules-ci/flake-parts";
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";
stable-diffusion-webui-nix.inputs.flake-utils.follows = "flake-utils";
stable-diffusion-webui-nix.inputs.nixpkgs.follows = "nixpkgs";
stable-diffusion-webui-nix.inputs.python-flexseal.follows = "python-flexseal";
stable-diffusion-webui-nix.url = "github:janrupf/stable-diffusion-webui-nix";
disko.url = "github:nix-community/disko";
home-manager.url = "github:nix-community/home-manager";
impermanence.url = "github:nix-community/impermanence";
nix-index-database.url = "github:nix-community/nix-index-database";
stylix.url = "github:nix-community/stylix";
systems.url = "github:nix-systems/default";
zjstatus.inputs.crane.follows = "crane";
zjstatus.inputs.flake-utils.follows = "flake-utils";
zjstatus.inputs.nixpkgs.follows = "nixpkgs";
zjstatus.inputs.rust-overlay.follows = "rust-overlay";
# Packages and services that we don't use nixpkgs for.
rrv-sh.url = "github:rrvsh/rrv.sh";
nvf.url = "github:rrvsh/nvf/uv-nvim";
stable-diffusion-webui-nix.url = "github:janrupf/stable-diffusion-webui-nix";
zjstatus.url = "github:dj95/zjstatus";
};
}

View file

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