-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
91 lines (85 loc) · 2.7 KB
/
flake.nix
File metadata and controls
91 lines (85 loc) · 2.7 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
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
{
description = "Otto's Nix Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Temporarily update for the new claude code version
# nixpkgs.url = "github:ottowhite/nixpkgs/bump-claude-code";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
otstack = {
url = "github:ottowhite/otstack";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, otstack, ... }:
let
# Helper function to create a home configuration
mkHomeConfiguration = { system, username, homeDirectory }:
home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
extraSpecialArgs = {
inherit username homeDirectory;
otstack-pkg = otstack.packages.${system}.default;
};
modules = [ ./home.nix ];
};
in
{
homeConfigurations = {
"ottowhite@Ottos-MacBook-Pro.local" = mkHomeConfiguration {
system = "aarch64-darwin";
username = "ottowhite";
homeDirectory = "/Users/ottowhite";
};
"otto@nixos" = mkHomeConfiguration {
system = "x86_64-linux";
username = "otto";
homeDirectory = "/home/otto";
};
# Generic Linux server
"ow20@server" = mkHomeConfiguration {
system = "x86_64-linux";
username = "ow20";
homeDirectory = "/home/ow20";
};
# Generic Linux server (ansible user)
"ansible@server" = mkHomeConfiguration {
system = "x86_64-linux";
username = "ansible";
homeDirectory = "/home/ansible";
};
};
# Keep the dev shell for backwards compatibility during transition
devShells = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
default = pkgs.mkShell {
packages = [
home-manager.packages.${system}.default
];
shellHook = ''
echo "Home Manager dev shell"
echo ""
echo "To apply your home configuration:"
echo " home-manager switch --flake .#ow20@nixos"
echo ""
echo "Or for a different machine:"
echo " home-manager switch --flake .#ow20@server"
export SHELL=$(which zsh)
exec zsh
'';
};
}
);
};
}