Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
132 lines (120 loc) · 3.62 KB
/
Copy pathflake.nix
File metadata and controls
132 lines (120 loc) · 3.62 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
description = "QiTech Control";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
nixpkgs,
home-manager,
...
}:
let
pkgs' = system: import nixpkgs { inherit system; };
forSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
in
{
formatter = forSystems (system: inputs.nixpkgs.legacyPackages.${system}.nixfmt-tree);
overlays.default =
# Add our own overlay for QiTech packages with commit hash support
(
final: prev: {
qitechPackages = {
server = prev.callPackage ./nixos/packages/server.nix { };
electron = prev.callPackage ./nixos/packages/electron.nix { };
gitInfo = prev.callPackage ./nixos/gitInfo.nix { pkgs = prev; };
};
}
);
packages = forSystems (
system: with (pkgs' system); rec {
default = server;
server = callPackage ./nixos/packages/server.nix { };
electron = callPackage ./nixos/packages/electron.nix { };
iso-x86_64 =
(nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
# QiTech Control module
self.nixosModules.qitech
# Home Manager module
home-manager.nixosModules.home-manager
# NixOS configuration
./nixos/os/iso.nix
{
nixpkgs.overlays = [
# Add our own overlay for QiTech packages with commit hash support
self.overlays.default
];
}
];
}).config.system.build.isoImage;
}
);
devShells = forSystems (system: {
default =
with (pkgs' system);
mkShell {
packages = with pkgs; [
cargo
rustc
pkg-config
libudev-zero
libpcap
nodejs_24
lldb
electron
# dev tools
nixfmt
nixd
rustfmt
rust-analyzer
clippy
];
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
# TODO: There's probably a better solution
ELECTRON_OVERRIDE_DIST_PATH = "${electron}/bin/";
hardeningDisable = [ "fortify" ];
shellHook = ''
echo "QiTech Control Development Environment"
echo "Rust version: $(rustc --version)"
echo "Node version: $(node --version)"
'';
};
});
nixosModules.qitech = import ./nixos/modules/qitech.nix;
nixosModules.default = self.nixosModules.qitech;
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
# QiTech Control module
self.nixosModules.qitech
# Home Manager module
home-manager.nixosModules.home-manager
# NixOS configuration
./nixos/os/bare-metal.nix
{
nixpkgs.overlays = [
# Add our own overlay for QiTech packages with commit hash support
self.overlays.default
];
}
];
};
};
}