-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
53 lines (53 loc) · 1.57 KB
/
Copy pathflake.nix
File metadata and controls
53 lines (53 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
description = "Myfish: a portable Linux and macOS home environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, home-manager, ... }:
let
machine = builtins.fromJSON (
builtins.readFile (
if builtins.pathExists ./machine.json then ./machine.json else ./machine.example.json
)
);
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
makeHome =
system:
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = { inherit machine; };
modules = [ ./modules/home.nix ];
};
in
{
homeConfigurations.commander = makeHome machine.system;
checks = forAllSystems (system: {
home = (makeHome system).activationPackage;
});
devShells = forAllSystems (system: {
default = nixpkgs.legacyPackages.${system}.mkShell {
COMMANDER_TEST_BASH = "${nixpkgs.legacyPackages.${system}.bashInteractive}/bin/bash";
packages = with nixpkgs.legacyPackages.${system}; [
python3
ripgrep
fish
zsh
shellcheck
starship
];
};
});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt);
};
}