-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
85 lines (70 loc) · 2.41 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
{
description = "Reverse socks proxy for nixos";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
#revsocks.url = "github:kost/revsocks";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, ... }:
let
# Systems that can run tests:
supportedSystems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
# Function to generate a set based on supported systems:
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
# Attribute set of nixpkgs for each system:
nixpkgsFor = forAllSystems (system:
import inputs.nixpkgs { inherit system; });
in
{
homeManagerModules.nix-revsocks = { ... }: {
imports = [ ./modules ];
};
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in
{
# default = self.packages.${system}.node-runtime;
# node-runtime = pkgs.writeShellApplication {
# name = "node";
# runtimeInputs = with pkgs; [ nodejs ];
# text = ''node ./modules/kwin.js "$@"'';
# };
# demo = (inputs.nixpkgs.lib.nixosSystem {
# inherit system;
# modules = [
# (import test/demo.nix {
# home-manager-module = inputs.home-manager.nixosModules.home-manager;
# nix-revsocks = self.homeManagerModules.nix-revsocks;
# })
# (_: {environment.systemPackages = [ self.packages.${system}.rc2nix]; })
# ];
# }).config.system.build.vm;
});
apps = forAllSystems (system: {
# default = self.apps.${system}.rc2nix;
# node-runtime = {
# type = "app";
# program = "${self.packages.${system}.node-runtime}/bin/node-runtime";
# };
});
checks = forAllSystems (system:
{
default = nixpkgsFor.${system}.callPackage ./test/basic.nix {
home-manager-module = inputs.home-manager.nixosModules.home-manager;
# plasma-module = self.homeManagerModules.nix-revsocks;
};
});
devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.mkShell {
buildInputs = with nixpkgsFor.${system}; [
git
nodejs
];
};
});
};
}