This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
109 lines (96 loc) · 2.88 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
101
102
103
104
105
106
107
108
109
{
description = "Madouura's NixOS configuration";
inputs = {
# NixOS
# TODO: Change to 23.11 when it's out
# nixpkgs.url = "github:nixos/nixpkgs/release-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# TODO: Remove later
nixpkgs-bcachefs.url = "github:Madouura/nixpkgs/pr/bcachefs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.darwin.follows = "";
};
# Home Manager
home-manager = {
# TODO: Change to 23.11 when it's out
# url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
# TODO: Remove later
nixpkgs-bcachefs,
nixos-hardware,
agenix,
home-manager
} @inputs: let
supportedSystems = [
"x86_64-linux"
"riscv64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = let
genericFor = pkgs: system: attrs: import pkgs ({ inherit system; } // attrs);
in forAllSystems (system:
genericFor nixpkgs system {
config.allowUnfree = true;
overlays = import ./overlays/default.nix {
pkgs-unstable = genericFor nixpkgs-unstable system { config.allowUnfree = true; };
# TODO: Remove later
pkgs-bcachefs = genericFor nixpkgs-bcachefs system { };
};
}
);
in rec {
devShells = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
busybox
git
gnumake
rage
agenix.packages.${system}.default
home-manager.packages.${system}.default
];
};
});
nixosConfigurations = {
ura = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-hidpi
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-ssd
agenix.nixosModules.default
./hosts/ura
];
specialArgs = { inherit inputs; };
};
};
homeConfigurations = {
"mado@ura" = home-manager.lib.homeManagerConfiguration {
pkgs = nixosConfigurations.ura.pkgs;
modules = [
agenix.homeManagerModules.default
./home/ura/mado
];
extraSpecialArgs = { inherit inputs; };
};
};
};
}