diff --git a/flake.nix b/flake.nix index 6b26849..b7b9601 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + tepid-client-services = { + url = "path:/home/alice/projects/tepid-client-services/"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + }; outputs = { @@ -28,7 +34,8 @@ lix-module, home-manager, nixos-hardware, - edit + edit, + tepid-client-services }: let system = "x86_64-linux"; @@ -48,7 +55,7 @@ name = hostname; value = nixpkgs.lib.nixosSystem { inherit system; - # _module.args = { inherit edit; }; + specialArgs = { inherit edit tepid-client-services; }; modules = defaultModules ++ modules; }; }; diff --git a/hosts/randolph/configuration.nix b/hosts/randolph/configuration.nix index 6cae58a..0d5a7aa 100644 --- a/hosts/randolph/configuration.nix +++ b/hosts/randolph/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, edit, tepid-client-services, flakelib, ... }: # fix this this is awful { imports = [ # Include the results of the hardware scan. @@ -158,6 +158,9 @@ shell = pkgs.zsh; }; home-manager.users.alice = import ./home.nix; + home-manager.extraSpecialArgs = { + inherit edit tepid-client-services flakelib; + }; # Make sure swaylock works (defined in home.nix) security.pam.services.swaylock = { }; diff --git a/hosts/randolph/home.nix b/hosts/randolph/home.nix index 4c6e190..fdbe1e5 100644 --- a/hosts/randolph/home.nix +++ b/hosts/randolph/home.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, tepid-client-services, ... }@inputs: rec { imports = [ @@ -23,13 +23,15 @@ rec { overlay = (final: prev: { olympus = prev.callPackage ../../pkgs/olympus/package.nix { }; olympus-unwrapped = prev.callPackage ../../pkgs/olympus-unwrapped/package.nix { }; + # edit_pkg = prev.callPackage inputs.edit.defaultPackage.x86_64-linux { }; + # tepid-client-services_pkg = prev.callPackage inputs.tepid-client-services.defaultPackage.x86_64-linux { }; }); in (with (pkgs.extend overlay); [ olympus ]) ++ (with pkgs; let archivo = callPackage ../../pkgs/archivo/archivo.nix { }; - # highway-gothic = callPackage ../../pkgs/highway-gothic/highway-gothic.nix { }; + highway-gothic = callPackage ../../pkgs/highway-gothic/highway-gothic.nix { }; in [ blueman @@ -73,7 +75,7 @@ rec { ibm-plex rubik archivo - # highway-gothic + highway-gothic merriweather-sans paratype-pt-sans paratype-pt-serif @@ -91,7 +93,7 @@ rec { hunspellDicts.fr-classique ] ++ # Spell checking [ keyutils ] ++ # Temp - [ ]); + []); programs.home-manager.enable = true; diff --git a/pkgs/celeste/celeste-linux.zip b/pkgs/celeste/celeste-linux.zip new file mode 100644 index 0000000..ac4fbc0 Binary files /dev/null and b/pkgs/celeste/celeste-linux.zip differ diff --git a/pkgs/celeste/default.nix b/pkgs/celeste/default.nix new file mode 100644 index 0000000..fffd58a --- /dev/null +++ b/pkgs/celeste/default.nix @@ -0,0 +1,122 @@ +{ + stdenvNoCC, + lib, + requireFile, + unzip, + copyDesktopItems, + xxd, + makeWrapper, + SDL2, + mono, + makeDesktopItem, + libfmodstudio_fix, + libfmodstudio, + libfna3d, + libfmodsdl, +}: +stdenvNoCC.mkDerivation rec { + name = "celeste-game"; + version = "1.4.0.0"; + + src = requireFile { + name = "celeste-linux.zip"; + url = "https://maddymakesgamesinc.itch.io/celeste"; + hash = "sha256-q4gniSgg00U3j5TZpvIZnSmqAyCHd/pOVAuQ3rDYEAs="; + }; + sourceRoot = "."; # needed for multiple directories + + nativeBuildInputs = [ + unzip # for unzipping + copyDesktopItems # will help! + makeWrapper + xxd + ]; + + buildInputs = [ + libfmodstudio_fix + libfmodstudio + libfna3d + SDL2 + libfmodsdl + + mono + ]; + + strictDeps = true; + dontConfigure = true; + + patchPhase = '' + # patch celeste + runHook prePatch + # TODO: i don't know what this magic string does and it bothers me + # TODO: convert these to patch files? + xxd -p < Celeste.exe | tr -d '\n' | LC_ALL=C sed 's/03000616fe012a0013300200210000000a000011160a02145112012014100100/03000616fe012a0013300200210000000a000011160a02145112012006020200/g' | xxd -r -p > Celeste.exe.patched + mv Celeste.exe.patched Celeste.exe + + # this cannot possibly be the best way of doing this + cat >Celeste.exe.config < + + + + + + + + + + EOF + + runHook postPatch + ''; + + dontBuild = true; + + installPhase = '' + runHook preInstall # these get clobbered + + mkdir -p $out/{bin,lib} + cp Celeste.exe Celeste.exe.config Celeste.pdb $out/lib + cp Celeste.Content.dll Celeste.Content.pdb $out/lib + cp FNA.dll FNA.dll.config FNA3D.dll $out/lib + cp -r Content/ $out/lib + cp -r Backups/ $out/lib + cp gamecontrollerdb.txt $out/lib + + mkdir -p $out/share/icons/hicolor/512x512/apps + cp Celeste.png $out/share/icons/hicolor/512x512/apps + + runHook postInstall + ''; + + postFixup = '' + makeWrapper "${mono}/bin/mono" "$out/bin/celeste-game" \ + --add-flags "--debug $out/lib/Celeste.exe" \ + --prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + "$out" + libfmodstudio_fix + libfmodstudio + libfna3d + SDL2 + libfmodsdl + ] + } + ''; + + desktopItems = [ + (makeDesktopItem { + name = name; + exec = "celeste-game %U"; + icon = "Celeste"; + comment = "Just breathe. You can do this..."; # should be an actual description of Celeste + desktopName = "Celeste"; + categories = [ + "Game" + "Application" + ]; + }) + ]; + + meta = { }; +} diff --git a/pkgs/edit/hi.nix b/pkgs/edit/hi.nix deleted file mode 100644 index 8ea921d..0000000 --- a/pkgs/edit/hi.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - description = "core-lending"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - - perSystem = { self', pkgs, system, ... }: - let - rustVersion = "1.86.0"; - rust = pkgs.rust-bin.stable.${rustVersion}; - rustPlatform = pkgs.makeRustPlatform { - rustc = rust.minimal; - cargo = rust.minimal; - }; - cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); - in - { - _module.args.pkgs = import inputs.nixpkgs { - inherit system; - overlays = [ inputs.rust-overlay.overlays.default ]; - }; - - packages.default = rustPlatform.buildRustPackage { - pname = cargoToml.package.name; - version = cargoToml.package.version; - - src = ./.; - cargoLock = { - lockFile = ./Cargo.lock; - }; - }; - - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.diesel-cli - pkgs.elmPackages.elm - pkgs.elmPackages.elm-language-server - pkgs.postgresql_17 - (rust.default.override { - extensions = [ "rust-analyzer" "rust-src" ]; - }) - ]; - - shellHook = '' - export LANG="en_US.UTF-8" - ''; - }; - }; - }; -} diff --git a/pkgs/edit/result b/pkgs/edit/result new file mode 120000 index 0000000..e5015cd --- /dev/null +++ b/pkgs/edit/result @@ -0,0 +1 @@ +/nix/store/v87dnjfc7275z6lwc52qa42vw773nvr3-edit-1.0.0 \ No newline at end of file diff --git a/snippets/clifm.nix b/snippets/clifm.nix index e082872..ff029c7 100644 --- a/snippets/clifm.nix +++ b/snippets/clifm.nix @@ -1,20 +1,20 @@ {lib, pkgs, ...}: let - overlay = (final: prev: { - clifm = prev.clifm.overrideAttrs (old: { - version = "1.23"; - src = prev.fetchFromGitHub { - owner = "leo-arch"; - repo = prev.clifm.pname; - rev = "v1.23"; - hash = "sha256-FtlLz77yy/QfRyAhJSh5juCSPCZ921sTGhuYJzCusus="; - }; - }); - }); + # overlay = (final: prev: { + # clifm = prev.clifm.overrideAttrs (old: { + # version = "1.23"; + # src = prev.fetchFromGitHub { + # owner = "leo-arch"; + # repo = prev.clifm.pname; + # rev = "v1.23"; + # hash = "sha256-FtlLz77yy/QfRyAhJSh5juCSPCZ921sTGhuYJzCusus="; + # }; + # }); + # }); file_picker = pkgs.writeScriptBin "file_picker" (builtins.readFile "${pkgs.clifm}/share/clifm/plugins/file_picker.sh"); in { - home.packages = with pkgs.extend overlay; [ atool fzf xdragon unzip zip sshfs clifm ] + home.packages = with pkgs; [ atool fzf xdragon unzip zip sshfs clifm ] ++ [ file_picker ]; xdg.configFile."clifm/profiles/default/clifmrc".source = ./clifm/clifmrc; xdg.configFile."clifm/profiles/default/mimelist.clifm".source = ./clifm/mimelist.clifm;