FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
containerlab/flake.nix at main · nemith/containerlab · GitHub
nemith
containerlab
Repository navigation
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
containerlab
/
flake.nix
Copy path
More file actions
More file actions
Latest commit
History
History
History
116 lines (104 loc) · 3.35 KB
Breadcrumbs
containerlab
/
flake.nix
Copy path
File metadata and controls
116 lines (104 loc) · 3.35 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
{
description
=
"containerlab - container-based networking labs"
;
inputs
.
nixpkgs
.
url
=
"github:NixOS/nixpkgs/nixos-unstable"
;
outputs
=
{
self
,
nixpkgs
}
:
let
# linux-only, matching .goreleaser.yml's goos list
systems
=
[
"x86_64-linux"
"aarch64-linux"
]
;
forAll
=
f
:
nixpkgs
.
lib
.
genAttrs
systems
(
s
:
f
nixpkgs
.
legacyPackages
.
${
s
}
)
;
version
=
"0.79.0"
;
in
{
packages
=
forAll
(
pkgs
:
rec
{
containerlab
=
pkgs
.
buildGoModule
{
pname
=
"containerlab"
;
inherit
version
;
src
=
./.
;
vendorHash
=
"sha256-mC2E00TTj5kyr1FI/7wRy/swFS87g56j5eHD+8yp8B8="
;
env
=
{
CGO_ENABLED
=
0
;
}
;
tags
=
[
"podman"
"exclude_graphdriver_btrfs"
"btrfs_noversion"
"exclude_graphdriver_devicemapper"
"exclude_graphdriver_overlay"
"containers_image_openpgp"
]
;
ldflags
=
[
"-s"
"-w"
"-X github.com/srl-labs/containerlab/cmd.Version=
${
version
}
"
"-X github.com/srl-labs/containerlab/cmd.commit=
${
self
.
shortRev
or
"unknown"
}
"
]
;
# stamp the build date (ISO 8601, UTC) of the flake revision,
# which keeps the build reproducible for a given input.
# note: self.lastModified (epoch) is used instead of
# self.lastModifiedDate, whose format varies across nix versions.
preBuild
=
''
ldflags+=" -X github.com/srl-labs/containerlab/cmd.date=$(date -u -d @
${
toString
self
.
lastModified
}
+%Y-%m-%dT%H:%M:%SZ)"
''
;
# tests need docker/root, skip them here
doCheck
=
false
;
meta
=
{
description
=
"Container-based networking labs"
;
homepage
=
"https://containerlab.dev"
;
license
=
nixpkgs
.
lib
.
licenses
.
bsd3
;
mainProgram
=
"containerlab"
;
platforms
=
nixpkgs
.
lib
.
platforms
.
linux
;
}
;
}
;
default
=
containerlab
;
}
)
;
nixosModules
.
default
=
{
config
,
lib
,
pkgs
,
...
}
:
let
cfg
=
config
.
programs
.
containerlab
;
in
{
options
.
programs
.
containerlab
=
{
enable
=
lib
.
mkEnableOption
"containerlab"
;
package
=
lib
.
mkOption
{
type
=
lib
.
types
.
package
;
default
=
self
.
packages
.
${
pkgs
.
stdenv
.
hostPlatform
.
system
}
.
containerlab
;
description
=
"The containerlab package to install."
;
}
;
}
;
config
=
lib
.
mkIf
cfg
.
enable
{
environment
.
systemPackages
=
[
cfg
.
package
]
;
security
.
wrappers
.
containerlab
=
{
source
=
"
${
cfg
.
package
}
/bin/containerlab"
;
owner
=
"root"
;
group
=
"root"
;
setuid
=
true
;
}
;
security
.
wrappers
.
clab
=
{
source
=
"
${
cfg
.
package
}
/bin/containerlab"
;
owner
=
"root"
;
group
=
"root"
;
setuid
=
true
;
}
;
users
.
groups
.
clab_admins
=
{
}
;
}
;
}
;
devShells
=
forAll
(
pkgs
:
{
default
=
pkgs
.
mkShell
{
packages
=
[
pkgs
.
go
pkgs
.
gopls
pkgs
.
golangci-lint
]
;
}
;
}
)
;
}
;
}
Back
|
FazBrowse Home
|
New Git URL