-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
96 lines (78 loc) · 3.01 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
{
inputs = {
# Principle inputs (updated by `nix run .#update`)
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
nixos-unified.url = "github:srid/nixos-unified";
systems.url = "github:nix-systems/default";
nixos-hardware.url = "github:nixos/nixos-hardware";
# Software inputs
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nvnix.url = "github:rsrohitsingh682/nvnix";
nvnix.inputs.nixpkgs.follows = "nixpkgs";
ragenix.url = "github:yaxitech/ragenix";
omnix.url = "github:juspay/omnix";
# Devshell
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
inputs.nixos-unified.flakeModule
inputs.treefmt-nix.flakeModule
./config.nix
];
perSystem = { pkgs, self', config, inputs', ... }: {
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixpkgs-fmt.enable = true;
};
devShells.default = pkgs.mkShell {
name = "nixos-config-shell";
meta.description = "Shell environment for modifying this Nix configuration";
packages = with pkgs; [
just
nixd
inputs'.ragenix.packages.default
];
};
packages.default = self'.packages.activate; # Enables `nix run`
};
flake.checks.x86_64-linux = {
enigma = self.nixosConfigurations.enigma.config.system.build.toplevel;
pi = self.nixosConfigurations.pi.config.system.build.toplevel;
riscv = self.nixosConfigurations.riscv.config.system.build.toplevel;
};
flake = {
# Configurations for Linux (NixOS) machines
nixosConfigurations = {
enigma = self.nixos-unified.lib.mkLinuxSystem { home-manager = true; } {
imports = [ ./machines/enigma/configuration.nix ];
nixos-unified.sshTarget = "enigma";
};
pi = self.nixos-unified.lib.mkLinuxSystem { home-manager = false; } {
imports = [
./machines/pi/configuration.nix
inputs.ragenix.nixosModules.default
];
nixos-unified.sshTarget = "pi";
};
riscv = self.nixos-unified.lib.mkLinuxSystem { home-manager = false; } {
imports = [
./machines/riscv/configuration.nix
];
nixos-unified.sshTarget = "riscv";
};
};
darwinConfigurations.zion = self.nixos-unified.lib.mkMacosSystem { home-manager = true; } {
imports = [ ./machines/zion/configuration.nix ];
};
};
};
}