Skip to content

Commit a02757d

Browse files
committed
refactor: Tidy up Flake and bump lockfile
1 parent 9b22ac1 commit a02757d

File tree

5 files changed

+51
-49
lines changed

5 files changed

+51
-49
lines changed

codid.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{ lib
2-
, pkgs ? import <nixpkgs>
3-
, rustPlatform
4-
,
1+
{
2+
lib,
3+
pkgs,
4+
rustPlatform,
55
}:
66
rustPlatform.buildRustPackage {
77
name = "codid";
@@ -17,11 +17,10 @@ rustPlatform.buildRustPackage {
1717
"--features=stock-codi,codios-codi,nixos"
1818
];
1919

20-
nativeBuildInputs = with pkgs; [ pkg-config protobuf ];
21-
buildInputs = with pkgs; [ systemd.dev ];
20+
nativeBuildInputs = with pkgs; [pkg-config protobuf];
21+
buildInputs = with pkgs; [systemd.dev];
2222

2323
meta = with lib; {
24-
description = "";
2524
homepage = "https://github.com/Cosmo-CoDiOS/codid";
2625
license = licenses.mit;
2726
};

default.nix

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
(import
1+
(
2+
import
23
(
3-
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
4-
fetchTarball {
5-
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
6-
sha256 = lock.nodes.flake-compat.locked.narHash;
7-
}
4+
let
5+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
6+
in
7+
fetchTarball {
8+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
9+
sha256 = lock.nodes.flake-compat.locked.narHash;
10+
}
811
)
9-
{ src = ./.; }
12+
{src = ./.;}
1013
).defaultNix

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@
77
flake = false;
88
};
99
};
10-
outputs = { self, ... } @ inputs:
11-
inputs.flake-utils.lib.eachDefaultSystem
12-
(system:
13-
let
14-
pkgs = inputs.nixpkgs.outputs.legacyPackages.${system};
15-
in
16-
{
17-
packages.codid = pkgs.callPackage ./codid.nix { };
18-
packages.default = self.outputs.packages.${system}.codid;
10+
outputs = inputs: let
11+
inherit (inputs) self flake-utils nixpkgs;
12+
in
13+
flake-utils.lib.eachDefaultSystem
14+
(system: let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
in {
17+
packages = {
18+
codid = pkgs.callPackage ./codid.nix {};
19+
default = self.packages.${system}.codid;
20+
};
1921

20-
devShells.default = self.packages.${system}.default.overrideAttrs (super: {
21-
nativeBuildInputs = with pkgs;
22-
super.nativeBuildInputs
23-
++ [
24-
clippy
25-
rustfmt
26-
];
27-
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
28-
});
29-
})
22+
devShells.default = pkgs.mkShell {
23+
inputsFrom = with self.packages.${system}; [codid];
24+
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
25+
};
26+
})
3027
// {
3128
overlays.default = final: prev: {
3229
inherit (self.packages.${final.system}) codid;

shell.nix

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
(import
1+
(
2+
import
23
(
3-
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
4-
fetchTarball {
5-
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
6-
sha256 = lock.nodes.flake-compat.locked.narHash;
7-
}
4+
let
5+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
6+
in
7+
fetchTarball {
8+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
9+
sha256 = lock.nodes.flake-compat.locked.narHash;
10+
}
811
)
9-
{ src = ./.; }
12+
{src = ./.;}
1013
).shellNix

0 commit comments

Comments
 (0)