add full proj
This commit is contained in:
85
flake.nix
Normal file
85
flake.nix
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
description = "A Wayland status bar for Sway, built with Quickshell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# Upstream Quickshell, tracked directly so we get layer-surface fixes
|
||||
# (e.g. clean buffers on output transform / rotation) ahead of nixpkgs.
|
||||
quickshell = {
|
||||
url = "git+https://git.outfoxxed.me/quickshell/quickshell";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, quickshell }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (pkgs:
|
||||
let
|
||||
# Quickshell from the upstream flake rather than nixpkgs.
|
||||
qsPkg = quickshell.packages.${pkgs.system}.default;
|
||||
|
||||
# Runtime tools the bar relies on: discover.sh (one-shot hardware
|
||||
# probe) and the periodic `df` for disk usage. Everything else is
|
||||
# read from /proc and /sys directly in QML.
|
||||
runtimeInputs = [
|
||||
qsPkg
|
||||
pkgs.bash
|
||||
pkgs.coreutils # df, cat
|
||||
];
|
||||
|
||||
# Self-contained font set so Nerd Font glyphs always render,
|
||||
# regardless of the host's installed fonts.
|
||||
fontsConf = pkgs.makeFontsConf {
|
||||
fontDirectories = [
|
||||
pkgs.nerd-fonts.jetbrains-mono
|
||||
pkgs.nerd-fonts.symbols-only
|
||||
pkgs.inter
|
||||
];
|
||||
};
|
||||
|
||||
bar = pkgs.writeShellApplication {
|
||||
name = "quickshell-bar";
|
||||
inherit runtimeInputs;
|
||||
text = ''
|
||||
export FONTCONFIG_FILE=${fontsConf}
|
||||
exec quickshell --path ${self} "$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
default = bar;
|
||||
quickshell-bar = bar;
|
||||
});
|
||||
|
||||
apps = forAllSystems (pkgs: {
|
||||
default = {
|
||||
type = "app";
|
||||
program = "${self.packages.${pkgs.system}.default}/bin/quickshell-bar";
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = [
|
||||
quickshell.packages.${pkgs.system}.default
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.nerd-fonts.jetbrains-mono
|
||||
pkgs.inter
|
||||
pkgs.qt6.qtdeclarative # qmlls / qmlformat for editing
|
||||
];
|
||||
shellHook = ''
|
||||
echo "quickshell $(quickshell --version 2>/dev/null | head -1)"
|
||||
echo "Run the bar with: quickshell --path ."
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user