-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
100 lines (98 loc) · 4.14 KB
/
flake.nix
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "Home Manager configuration";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-stable-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
pdhpkg.url = "github:mbovo/pdh";
nix-configs-priv = {
url = "git+ssh://git@github.com/mbovo/nix-configs-priv?ref=main";
flake = false;
};
};
outputs = { home-manager,flake-utils, ... }@inputs:
let
# defaults modules for all systems
mods = {
common = [ inputs.sops-nix.homeManagerModules.sops ./common/flake.nix ];
darwin = [ ./common/darwin.nix ./common/docker4mac.nix ];
linux = [ ./common/linux.nix ];
};
# default paths for all systems
paths = {
home = {
x86_64-darwin = "/Users/";
aarch64-darwin = "/Users/";
x86_64-linux = "/home/";
aarch64-linux = "/home/";
};
};
in
## building dev-shell for all
flake-utils.lib.eachDefaultSystem
(system:{
devShells.default = inputs.nixpkgs-stable.legacyPackages.${system}.mkShell {
packages = with inputs.nixpkgs-stable.legacyPackages.${system}; [
statix
go-task
sops
nix-output-monitor
git
gh
age
];
};
}
)
//
## home-manager configurations
{
homeConfigurations = {
# ==================================================================================================================
# personal MacOs configuration
# ==================================================================================================================
"manuel@mbp" = home-manager.lib.homeManagerConfiguration rec{
pkgs = extraSpecialArgs.pkgs-stable; # using nixpgs-unstable as default (see below)
extraSpecialArgs = rec{
system = "x86_64-darwin";
username = "manuel";
hostname = "mbp";
homeDirectory = "${paths.home.${system}}${username}";
pkgs-stable = inputs.nixpkgs-stable-darwin.legacyPackages.${system};
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
pdh = inputs.pdhpkg.packages.${system};
priv-config = inputs.nix-configs-priv;
};
modules = mods.common ++ mods.darwin ++ [ "${extraSpecialArgs.priv-config}/hosts/${extraSpecialArgs.hostname}/nix/custom.nix" ];
};
# ==================================================================================================================
# ==================================================================================================================
# work MacOs configuration
# ==================================================================================================================
"manuel.bovo@manuel.bovo" = home-manager.lib.homeManagerConfiguration rec{
pkgs = extraSpecialArgs.pkgs-stable; # using nixpgs-stable as default (see below)
extraSpecialArgs = rec{
system = "aarch64-darwin";
hostname = "manuel.bovo";
username = "${hostname}";
homeDirectory = "${paths.home.${system}}${username}";
pkgs-stable = inputs.nixpkgs-stable-darwin.legacyPackages.${system};
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
pdh = inputs.pdhpkg.packages.${system};
priv-config = inputs.nix-configs-priv;
};
modules = mods.common ++ mods.darwin ++ [ "${extraSpecialArgs.priv-config}/hosts/${extraSpecialArgs.hostname}/nix/custom.nix" ];
};
# ==================================================================================================================
};
};
}