Skip to content

Commit 3e98dcb

Browse files
committed
nix: re-organize flake structure
1 parent d8de68e commit 3e98dcb

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

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: 1 addition & 1 deletion
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
File renamed without changes.

0 commit comments

Comments
 (0)