Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
81 lines (69 loc) · 2.29 KB
/
Copy pathflake.nix
File metadata and controls
81 lines (69 loc) · 2.29 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
{
description = "flakes for m[A]chines";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
# Fast-moving packages that stable lags badly on (see the overlay in
# ./common/configuration.nix). Keep this list small — everything else
# should come from the stable nixpkgs above.
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
my-nautilus = {
url = "github:yannmasoch/nautilus-my-computer?dir=packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
flake-parts,
nixpkgs,
home-manager,
disko,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
flake = let
# Build a NixOS host from its per-host module directory. Every
# host shares ./common/configuration.nix and the same home-manager
# setup; only ./hosts/<name> differs (hostName, bootloader, the
# hardware scan). Add a new machine with one more line below.
mkHost = hostModule:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs;};
modules = [
./common/configuration.nix
hostModule
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit inputs;};
users.bemeritus = ./common/home.nix;
backupFileExtension = "backup";
};
}
];
};
in {
homeModules.git = ./modules/home/git.nix;
homeModules.starship = ./modules/home/starship.nix;
nixosConfigurations = {
bemeritus = mkHost ./hosts/bemeritus;
laptop = mkHost ./hosts/laptop;
};
};
perSystem = {pkgs, ...}: {
devShells.default = import ./shell.nix {inherit pkgs inputs;};
};
};
}