Something went wrong. Try again.
Some shell. slowshell.bushyice.com
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170{ description = "slowshell";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; crane.url = "github:ipetkov/crane/v0.24.0"; };
outputs = { self, nixpkgs, crane, ... }: let inherit (nixpkgs) lib;
systems = [ "aarch64-linux" "x86_64-linux" ];
eachSystem = f: let perSystem = lib.genAttrs systems f; in lib.foldl' ( acc: system: lib.mapAttrs (name: value: (acc.${name} or { }) // { ${system} = value; }) perSystem.${system} ) { } systems;
runtimeLibs = pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.libGL pkgs.vulkan-loader pkgs.mesa ];
wrapVulkanSetup = pkgs: '' if [ -z "$VULKAN_ICD_FILENAMES" ]; then _icd_dirs="${pkgs.mesa.driverLink}/share/vulkan/icd.d /run/opengl-driver/share/vulkan/icd.d" _icds="" for _d in $_icd_dirs; do if [ -d "$_d" ]; then for _f in "$_d"/*.json; do [ -f "$_f" ] && _icds="''${_icds:+$_icds:}$_f" done fi done [ -n "$_icds" ] && export VULKAN_ICD_FILENAMES="$_icds" unset _icd_dirs _icds _d _f fi ''; in { # The Home Manager module is system independent: it takes `pkgs` from the # Home Manager evaluation, so one file serves every platform. homeManagerModules = { slowshell = import ./nix/hm-module.nix; default = self.homeManagerModules.slowshell; }; } // eachSystem ( system: let pkgs = nixpkgs.legacyPackages.${system}; craneLib = crane.mkLib pkgs; libs = runtimeLibs pkgs;
src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ (craneLib.fileset.commonCargoSources ./.) ./assets (lib.fileset.fileFilter (file: file.hasExt "kdl" || file.hasExt "icss") ./.) ]; };
shellCrate = craneLib.crateNameFromCargoToml { cargoToml = ./crates/slowshell/Cargo.toml; };
commonArgs = { inherit src; strictDeps = true; inherit (shellCrate) pname version;
nativeBuildInputs = [ pkgs.pkg-config pkgs.makeWrapper ];
buildInputs = libs; };
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
slowshell = craneLib.buildPackage ( commonArgs // { inherit cargoArtifacts;
doCheck = false;
postFixup = '' wrapProgram $out/bin/slowshell \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}" \ --run '${wrapVulkanSetup pkgs}' '';
meta = { description = "Some shell"; homepage = "https://tangled.org/bushyice.com/slowshell"; mainProgram = "slowshell"; platforms = lib.platforms.linux; license = lib.licenses.gpl3Plus; }; } ); in { packages = { inherit slowshell; default = slowshell; };
apps.default = { type = "app"; program = lib.getExe slowshell; };
checks = { inherit slowshell;
# The Home Manager module is evaluated against a stub of the Home # Manager options it uses, so the generated config is built (and # validated) as part of `nix flake check` without adding # home-manager as a dependency of this flake. home-manager-module = import ./nix/hm-check.nix { inherit lib pkgs slowshell; }; };
devShells.default = craneLib.devShell { packages = [ pkgs.git pkgs.just pkgs.pkg-config pkgs.rust-analyzer pkgs.socat ];
buildInputs = libs;
LD_LIBRARY_PATH = lib.makeLibraryPath libs;
shellHook = '' ${wrapVulkanSetup pkgs} echo "Rust: $(rustc --version)" echo "Vulkan ICD: ${"$"}{VULKAN_ICD_FILENAMES:-none found}" echo "build the shell with: nix build .#slowshell" ''; }; } );}