Skip to content

Commit

Permalink
Update nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
vlinkz committed Feb 7, 2023
1 parent ee45ac3 commit 0174ad2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 95 deletions.
23 changes: 13 additions & 10 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
{ pkgs ? import <nixpkgs> { }
, lib ? import <nixpkgs/lib>
}:
pkgs.rustPlatform.buildRustPackage {
pname = "nix-editor";
version = "0.3.0";

src = [ ./. ];

cargoLock = {
lockFile = ./Cargo.lock;
};
}
81 changes: 16 additions & 65 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 23 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,36 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, naersk, ... }:
flake-utils.lib.eachDefaultSystem (system:
outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
naersk-lib = naersk.lib."${system}";
name = "nix-editor";
in
{
packages.nixeditor = naersk-lib.buildPackage {
pname = "nix-editor";
root = ./.;
};
rec
{
packages.${name} = pkgs.callPackage ./default.nix {
inherit (inputs);
};

# `nix build`
defaultPackage = packages.${name};

defaultPackage = self.packages.${system}.nixeditor;
# `nix run`
apps.${name} = utils.lib.mkApp {
inherit name;
drv = packages.${name};
};
defaultApp = apps.${name};

checks = self.packages.${system};
hydraJobs = self.packages.${system};
checks = self.packages.${system};
hydraJobs = self.packages.${system};

devShell = pkgs.mkShell {
buildInputs = with pkgs; [
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
rust-analyzer
rustc
rustfmt
Expand All @@ -38,5 +41,5 @@
clippy
];
};
});
});
}

0 comments on commit 0174ad2

Please sign in to comment.