Skip to content

Commit fab3e12

Browse files
authored
Merge pull request #195 from NotAShelf/master
nix: housekeeping
2 parents a808e6d + 0109732 commit fab3e12

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"anyrun",
45
"anyrun-plugin",

flake.nix

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# it is possible to streamline calling packages with a single function
3636
# that takes name as an argument, and handles default inherits.
3737
mkPlugin = name:
38-
callPackage ./nix/plugins/default.nix {
38+
callPackage ./nix/packages/plugin.nix {
3939
inherit inputs lockFile;
4040
inherit name;
4141
};
@@ -44,8 +44,8 @@
4444

4545
# By default the anyrun package is built without any plugins
4646
# as per the `dontBuildPlugins` arg.
47-
anyrun = callPackage ./nix/default.nix {inherit inputs lockFile;};
48-
anyrun-with-all-plugins = callPackage ./nix/default.nix {
47+
anyrun = callPackage ./nix/packages/anyrun.nix {inherit inputs lockFile;};
48+
anyrun-with-all-plugins = callPackage ./nix/packages/anyrun.nix {
4949
inherit inputs lockFile;
5050
dontBuildPlugins = false;
5151
};
@@ -72,19 +72,19 @@
7272
default = pkgs.mkShell {
7373
inputsFrom = builtins.attrValues self'.packages;
7474
packages = with pkgs; [
75-
rustc # rust compiler
75+
rustc
7676
gcc
77-
cargo # rust package manager
78-
clippy # opinionated rust formatter
77+
cargo
78+
clippy
79+
rustfmt
7980
];
8081
};
8182

8283
nix = pkgs.mkShellNoCC {
8384
packages = with pkgs; [
84-
alejandra # nix formatter
85-
rustfmt # rust formatter
86-
statix # lints and suggestions
87-
deadnix # clean up unused nix code
85+
alejandra # formatter
86+
statix # linter
87+
deadnix # dead-code finder
8888
];
8989
};
9090
};
@@ -95,7 +95,7 @@
9595

9696
flake = {
9797
homeManagerModules = {
98-
anyrun = import ./nix/hm-module.nix self;
98+
anyrun = import ./nix/modules/home-manager.nix self;
9999
default = self.homeManagerModules.anyrun;
100100
};
101101
};

nix/hm-module.nix renamed to nix/modules/home-manager.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ self: {
22
config,
33
pkgs,
44
lib,
5-
hm,
65
...
76
}: let
8-
cfg = config.programs.anyrun;
9-
10-
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
11-
127
inherit (builtins) map toJSON toString substring stringLength;
138
inherit (lib.modules) mkIf mkMerge;
149
inherit (lib.options) mkOption mkEnableOption literalExpression;
@@ -17,6 +12,9 @@ self: {
1712
inherit (lib.strings) toLower toUpper replaceStrings;
1813
inherit (lib.trivial) boolToString;
1914
inherit (lib.types) nullOr package submodule int float listOf either str enum lines bool attrs;
15+
16+
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
17+
cfg = config.programs.anyrun;
2018
in {
2119
meta.maintainers = with lib.maintainers; [n3oney NotAShelf];
2220

nix/default.nix renamed to nix/packages/anyrun.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}: let
2323
inherit (builtins) fromTOML readFile;
2424

25-
cargoToml = fromTOML (readFile ../anyrun/Cargo.toml);
25+
cargoToml = fromTOML (readFile ../../anyrun/Cargo.toml);
2626
pname = cargoToml.package.name;
2727
version = cargoToml.package.version;
2828
in
@@ -39,8 +39,6 @@ in
3939
inherit lockFile;
4040
};
4141

42-
checkInputs = [cargo rustc];
43-
4442
nativeBuildInputs = [
4543
pkg-config
4644
makeWrapper
@@ -63,14 +61,16 @@ in
6361
else [];
6462

6563
doCheck = true;
64+
checkInputs = [cargo rustc];
65+
6666
copyLibs = true;
6767

6868
buildAndTestSubdir =
6969
if dontBuildPlugins
7070
then pname
7171
else null;
7272

73-
CARGO_BUILD_INCREMENTAL = "false";
73+
CARGO_BUILD_INCREMENTAL = 0;
7474
RUST_BACKTRACE = "full";
7575

7676
postInstall = ''
@@ -82,7 +82,7 @@ in
8282
meta = {
8383
description = "A wayland native, highly customizable runner.";
8484
homepage = "https://github.com/Kirottu/anyrun";
85-
license = with lib.licenses; [gpl3];
85+
license = [lib.licenses.gpl3];
8686
mainProgram = "anyrun";
8787
maintainers = with lib.maintainers; [NotAShelf n3oney];
8888
};

nix/plugins/default.nix renamed to nix/packages/plugin.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
gtk-layer-shell,
1111
pkg-config,
1212
librsvg,
13+
cargo,
14+
rustc,
1315
# Generic args
1416
name,
1517
lockFile,
@@ -49,17 +51,22 @@ in
4951
++ extraInputs;
5052

5153
doCheck = true;
54+
checkInputs = [
55+
cargo
56+
rustc
57+
];
58+
5259
copyLibs = true;
5360
cargoBuildFlags = ["-p ${name}"];
5461
buildAndTestSubdir = "plugins/${name}";
5562

56-
CARGO_BUILD_INCREMENTAL = "false";
63+
CARGO_BUILD_INCREMENTAL = 0;
5764
RUST_BACKTRACE = "full";
5865

5966
meta = {
6067
description = "The ${name} plugin for Anyrun";
6168
homepage = "https://github.com/Kirottu/anyrun";
62-
license = with lib.licenses; [gpl3];
69+
license = [lib.licenses.gpl3];
6370
maintainers = with lib.maintainers; [NotAShelf n3oney];
6471
};
6572
}

0 commit comments

Comments
 (0)