-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
139 lines (125 loc) · 3.58 KB
/
Copy pathflake.nix
File metadata and controls
139 lines (125 loc) · 3.58 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
133
134
135
136
137
138
139
{
description = "Sophon development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
ansibleEnv = pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
ansible-core
proxmoxer
requests
websocket-client
]);
fuseNfs = pkgs.stdenv.mkDerivation rec {
pname = "fuse-nfs";
version = "unstable-2025-02-25";
src = pkgs.fetchFromGitHub {
owner = "sahlberg";
repo = "fuse-nfs";
rev = "75827244f1615be20da880cbc68665416131088d";
sha256 = "sha256-QmsC0FLbSHko9Pfe6Nk2p1xyViUbqY6lCiGgn1J1KeA=";
};
nativeBuildInputs = with pkgs; [
pkg-config
autoconf
automake
libtool
m4
libxslt
fuse.dev
libnfs
];
buildInputs = with pkgs; [
fuse
libnfs
];
preConfigure = "./setup.sh";
};
sophonDevPackages = with pkgs; [
ansibleEnv
ansible-lint
apacheHttpd
butane
skopeo
dnf5
qemu
libguestfs-with-appliance
proot
unixtools.xxd
nfs-utils
fuse
libnfs
fuseNfs
cloudflared
gnumake
go
git
cacert
buildah
mkpasswd
dig
bubblewrap
socat
tailscale
];
sophonRunnerImagePackages = sophonDevPackages ++ (with pkgs; [
bashInteractive
coreutils
findutils
gawk
gnugrep
gnused
gnutar
gzip
nix
which
]);
in
{
packages = {
fuseNfs = fuseNfs;
sophon-dev-env = pkgs.buildEnv {
name = "sophon-dev-env";
paths = sophonDevPackages;
};
sophon-runner-image = pkgs.dockerTools.buildLayeredImage {
name = "sophon-nix-runner";
tag = "latest";
contents = sophonRunnerImagePackages;
extraCommands = ''
mkdir -p workspace tmp etc/nix
chmod 1777 tmp
cat > etc/nix/nix.conf <<'EOF'
experimental-features = nix-command flakes
sandbox = false
filter-syscalls = false
EOF
'';
config = {
Cmd = [ "${pkgs.bashInteractive}/bin/bash" ];
WorkingDir = "/workspace";
Env = [
"HOME=/tmp"
"NIX_CONFIG=experimental-features = nix-command flakes"
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
"PATH=${lib.makeBinPath sophonRunnerImagePackages}"
];
};
};
};
devShells.default = pkgs.mkShell {
packages = sophonDevPackages;
shellHook = ''
if [ ! -d "$HOME/.ansible/collections/ansible_collections/community/proxmox" ]; then
ansible-galaxy collection install community.proxmox community.general community.docker ansible.posix --force
fi
'';
};
});
}