-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
94 lines (82 loc) · 2.31 KB
/
flake.nix
File metadata and controls
94 lines (82 loc) · 2.31 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
92
93
94
{
description = "My NixOS Configurations Flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
nixos-facter-modules.url = "github:nix-community/nixos-facter-modules";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
secrets = {
url = "git+ssh://git@github.com/mtpham99/secrets?ref=main";
flake = false;
};
assets = {
url = "git+ssh://git@github.com/mtpham99/assets?ref=main";
flake = false;
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
walker.url = "github:abenz1267/walker";
};
outputs =
{
nixpkgs,
nixos-hardware,
nixos-facter-modules,
disko,
sops-nix,
home-manager,
secrets,
assets,
firefox-addons,
hyprland,
walker,
...
}@inputs:
let
supportedSystems = [ "x86_64-linux" ];
pkgsFor = system: import nixpkgs { inherit system; };
forAllPkgs = fn: nixpkgs.lib.genAttrs supportedSystems (system: fn (pkgsFor system));
in
{
# `nixos-rebuild { build | switch | ... } --flake .#<hostname>`
nixosConfigurations = {
grunfeld = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixos-facter-modules.nixosModules.facter
disko.nixosModules.disko
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
./hosts/grunfeld/configuration.nix
];
specialArgs = { inherit inputs; };
};
};
# `nix develop`
devShells = forAllPkgs (pkgs: {
default = import ./shell.nix { inherit pkgs; };
});
# `nix fmt`
formatter = forAllPkgs (
pkgs:
pkgs.treefmt.withConfig {
runtimeInputs = [ pkgs.nixfmt-rfc-style ];
settings = pkgs.lib.importTOML ./treefmt.toml;
}
);
};
}