diff --git a/.gitea/workflows/publish-attic.yaml b/.gitea/workflows/publish-attic.yaml index a342738..322c579 100644 --- a/.gitea/workflows/publish-attic.yaml +++ b/.gitea/workflows/publish-attic.yaml @@ -63,6 +63,7 @@ jobs: system="$(nix eval --impure --raw --expr builtins.currentSystem)" NIXPKGS_ALLOW_UNFREE=1 nix build --impure --accept-flake-config --no-link --print-out-paths -L \ + ".#packages.${system}.atuinLatest" \ ".#packages.${system}.musicpresence" \ ".#packages.${system}.vintage-story" \ ".#packages.${system}.swaytreesave" \ diff --git a/flake.lock b/flake.lock index 1907232..a4c4892 100644 --- a/flake.lock +++ b/flake.lock @@ -99,11 +99,11 @@ ] }, "locked": { - "lastModified": 1787750582, - "narHash": "sha256-FfIAV44k33i+IjC1+new2KyjyVGUzGtV89VHVP4eK1U=", + "lastModified": 1787778830, + "narHash": "sha256-GnLPpDT727E6VpDlALP8JeP1BbSQ17H0HiEEYq6Ql4w=", "owner": "nix-community", "repo": "home-manager", - "rev": "0a364342a66bcecfc8a00d2fc38c6c29eee7bc5e", + "rev": "6b449e35980e1b75dd17da2d6d9b66e757194f1c", "type": "github" }, "original": { @@ -114,11 +114,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1787640266, - "narHash": "sha256-MrkfE5hF5xx4L/0h5NyJ3xQkKVftwSuKSkFSrvlTxGY=", + "lastModified": 1787753485, + "narHash": "sha256-BZWCi9ZRJiARTuKTbbtvFTj7t1TK4G3UEckT3HyNfRg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f4f698677b11021a8f84f452e23ae9ef2427bec3", + "rev": "062346a6d85bc4b49dfaa61c986e9c5be21217d1", "type": "github" }, "original": { @@ -134,7 +134,8 @@ "darwin": "darwin", "hildibrand": "hildibrand", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay_3" } }, "rust-overlay": { @@ -178,6 +179,26 @@ "repo": "rust-overlay", "type": "github" } + }, + "rust-overlay_3": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1787713867, + "narHash": "sha256-ZRYTEvDb8QZLCHRoMyIZle9V3Bvw905m0teeo1RvI7M=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "494680f9ffa2b4bf9f2df0f442c7096e44adfa00", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8105409..c3234a0 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,18 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; darwin.url = "github:LnL7/nix-darwin"; darwin.inputs.nixpkgs.follows = "nixpkgs"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hildibrand.url = "git+https://scm.wyattjmiller.com/wymiller/hildibrand.git"; hildibrand.inputs.nixpkgs.follows = "nixpkgs"; caitsith.url = "git+https://scm.wyattjmiller.com/wymiller/caitsith.git"; caitsith.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ self, nixpkgs, home-manager, darwin, ... }: + outputs = inputs@{ self, nixpkgs, home-manager, darwin, rust-overlay, ... }: let supportedSystems = [ "x86_64-linux" @@ -23,7 +28,8 @@ forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems f; in { - packages = forAllSystems (system: + packages = forAllSystems ( + system: let pkgs = import nixpkgs { inherit system; @@ -39,18 +45,24 @@ } ); - devShells = forAllSystems (system: - let pkgs = import nixpkgs { inherit system; }; in + devShells = forAllSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in { default = pkgs.mkShell { - packages = with pkgs; [ - nixfmt-rfc-style + packages = with pkgs; [ + nixfmt-rfc-style ]; }; } ); - overlays.default = import ./overlays; + overlays.default = nixpkgs.lib.composeManyExtensions [ + rust-overlay.overlays.default + (import ./overlays) + ]; homeManagerModules = import ./modules/home-manager self; nixosModules.default = import ./modules/nixos; darwinModules.default = import ./modules/darwin; diff --git a/overlays/default.nix b/overlays/default.nix index ce16870..6bca2b5 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1 +1,43 @@ -final: prev: { } +final: prev: +let + rustLatest = prev.rust-bin.stable.latest.default; + rustPlatform = prev.makeRustPlatform { + cargo = rustLatest; + rustc = rustLatest; + }; +in +{ + atuinLatest = (prev.atuin.override { inherit rustPlatform; }).overrideAttrs (oldAttrs: rec { + version = "18.19.0"; + + src = prev.fetchFromGitHub { + owner = "atuinsh"; + repo = "atuin"; + rev = "v${version}"; + hash = "sha256-yAw+ty6FUnFbiRTdAe2QQHzj6uU24fZ/bEIXcHl/thg="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit src; + hash = "sha256-jirVe0+N5+UHZWioj8AipUhawMBameqEJJpa8HPTnfw="; + }; + + cargoBuildFeatures = [ + "ai" + "client" + "clipboard" + "daemon" + "hex" + "sync" + ]; + cargoCheckFeatures = cargoBuildFeatures; + + preCheck = (oldAttrs.preCheck or "") + '' + export HOME="$TMPDIR" + export XDG_CONFIG_HOME="$TMPDIR/.config" + export XDG_DATA_HOME="$TMPDIR/.local/share" + export XDG_STATE_HOME="$TMPDIR/.local/state" + mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_STATE_HOME" + ''; + }); +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 6611160..d28ca60 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,16 +4,17 @@ caitsith ? null }: { + atuinLatest = pkgs.atuinLatest; # any packages that are added to pkgs and are inputs, we inherit them here inherit hildibrand; inherit caitsith; # any packages that build instructions are in this repo, they go here # sable-web = pkgs.callPackage ./common/sable.nix {}; - swaytreesave = pkgs.callPackage ./linux/swaytreesave.nix {}; - musicpresence = pkgs.callPackage ./linux/musicpresence.nix {}; - vintage-story = pkgs.callPackage ./linux/vintage-story.nix {}; - archon = pkgs.callPackage ./linux/archon.nix {}; + swaytreesave = pkgs.callPackage ./linux/swaytreesave.nix { }; + musicpresence = pkgs.callPackage ./linux/musicpresence.nix { }; + vintage-story = pkgs.callPackage ./linux/vintage-story.nix { }; + archon = pkgs.callPackage ./linux/archon.nix { }; yubilock = pkgs.callPackage ./linux/yubilock/default.nix { }; ani-cli-rs = pkgs.callPackage ./linux/ani-cli-rs.nix { }; }