Files
NixOS/flake.nix

93 lines
2.8 KiB
Nix

{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
zen-browser.inputs.nixpkgs.follows = "nixpkgs";
grub2-themes = { url = "github:vinceliuice/grub2-themes"; };
trayscale-src = {
url = "github:DeedleFake/trayscale/v0.18.3";
flake = false;
};
};
outputs = inputs@{ nixpkgs, home-manager, zen-browser, grub2-themes, trayscale-src, ... }:
let
username = "cookiez";
version = "25.05";
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
hyprlandEnabled = false;
plasmaEnabled = true;
trayscale-flake = pkgs.buildGoModule {
pname = "trayscale-flake";
version = "0.18.3";
src = trayscale-src;
vendorHash = "sha256-8Um5Ps1EEVShJEeCRkGE3pJi2/5PxgEVNqq3JsKdivA=";
# Trayscale uses gotk4 → needs pkg-config, GTK4, libadwaita, etc.
nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook4
];
buildInputs = [
pkgs.gtk4
pkgs.libadwaita
pkgs.gobject-introspection
pkgs.gdk-pixbuf
pkgs.glib
pkgs.cairo
pkgs.pango
pkgs.harfbuzz
pkgs.librsvg
];
# gotk4 uses cgo
env.CGO_ENABLED = 1;
# Only build the actual app binary
subPackages = [ "cmd/trayscale" ];
};
in
{
nixosConfigurations = {
#Replace the below with your hostname!!! Like: {hostname} = nixpkgs.lib.nixosSystem {
nixos = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs username version hyprlandEnabled;
trayscale-flake = trayscale-flake;
};
modules = [
./configuration.nix
./firefox.nix
./zsh.nix
#./neovim.nix
./packages.nix
grub2-themes.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = ./home.nix;
home-manager.backupFileExtension = "backup"; # Automatically backs up conflicting files during activation
home-manager.extraSpecialArgs = { inherit inputs username version hyprlandEnabled; system = "x86_64-linux"; };
}
#Conditional Modules!
] ++ (if hyprlandEnabled then [ ./hyprland/hyprland.nix ] else [ ]) ++ [
] ++ (if plasmaEnabled then [ ./plasma/kde-plasma.nix ] else [ ]) ++ [
];
};
};
};
}