Nico Jensch commited on
Commit
32b2b27
1 Parent(s): d110f40

feat: add flake.nix to allow building NixOS packages

Browse files
Files changed (2) hide show
  1. flake.lock +94 -0
  2. flake.nix +51 -0
flake.lock ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nodes": {
3
+ "naersk": {
4
+ "inputs": {
5
+ "nixpkgs": "nixpkgs"
6
+ },
7
+ "locked": {
8
+ "lastModified": 1694081375,
9
+ "narHash": "sha256-vzJXOUnmkMCm3xw8yfPP5m8kypQ3BhAIRe4RRCWpzy8=",
10
+ "owner": "nix-community",
11
+ "repo": "naersk",
12
+ "rev": "3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89",
13
+ "type": "github"
14
+ },
15
+ "original": {
16
+ "owner": "nix-community",
17
+ "ref": "master",
18
+ "repo": "naersk",
19
+ "type": "github"
20
+ }
21
+ },
22
+ "nixpkgs": {
23
+ "locked": {
24
+ "lastModified": 1695318763,
25
+ "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=",
26
+ "path": "/nix/store/p7iz0r8gs6ppkhj83zjmwyd21k8b7v3y-source",
27
+ "rev": "e12483116b3b51a185a33a272bf351e357ba9a99",
28
+ "type": "path"
29
+ },
30
+ "original": {
31
+ "id": "nixpkgs",
32
+ "type": "indirect"
33
+ }
34
+ },
35
+ "nixpkgs_2": {
36
+ "locked": {
37
+ "lastModified": 1695318763,
38
+ "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=",
39
+ "owner": "NixOS",
40
+ "repo": "nixpkgs",
41
+ "rev": "e12483116b3b51a185a33a272bf351e357ba9a99",
42
+ "type": "github"
43
+ },
44
+ "original": {
45
+ "owner": "NixOS",
46
+ "ref": "nixpkgs-unstable",
47
+ "repo": "nixpkgs",
48
+ "type": "github"
49
+ }
50
+ },
51
+ "root": {
52
+ "inputs": {
53
+ "naersk": "naersk",
54
+ "nixpkgs": "nixpkgs_2",
55
+ "utils": "utils"
56
+ }
57
+ },
58
+ "systems": {
59
+ "locked": {
60
+ "lastModified": 1681028828,
61
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
62
+ "owner": "nix-systems",
63
+ "repo": "default",
64
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
65
+ "type": "github"
66
+ },
67
+ "original": {
68
+ "owner": "nix-systems",
69
+ "repo": "default",
70
+ "type": "github"
71
+ }
72
+ },
73
+ "utils": {
74
+ "inputs": {
75
+ "systems": "systems"
76
+ },
77
+ "locked": {
78
+ "lastModified": 1694529238,
79
+ "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
80
+ "owner": "numtide",
81
+ "repo": "flake-utils",
82
+ "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
83
+ "type": "github"
84
+ },
85
+ "original": {
86
+ "owner": "numtide",
87
+ "repo": "flake-utils",
88
+ "type": "github"
89
+ }
90
+ }
91
+ },
92
+ "root": "root",
93
+ "version": 7
94
+ }
flake.nix ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ # Websurfx NixOS flake
3
+ inputs = {
4
+ naersk.url = "github:nix-community/naersk/master";
5
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6
+ utils.url = "github:numtide/flake-utils";
7
+ };
8
+
9
+ outputs = {
10
+ naersk,
11
+ nixpkgs,
12
+ self,
13
+ utils,
14
+ }:
15
+ # We do this for all systems - namely x86_64-linux, aarch64-linux,
16
+ # x86_64-darwin and aarch64-darwin
17
+ utils.lib.eachDefaultSystem (system: let
18
+ pkgs = import nixpkgs {inherit system;};
19
+ naersk-lib = pkgs.callPackage naersk {};
20
+ in rec {
21
+ # Build via nix build .#defaultPackage.x86_64-linux
22
+ defaultPackage = naersk-lib.buildPackage {
23
+ # The build dependencies
24
+ buildInputs = with pkgs; [pkg-config openssl];
25
+ src = ./.;
26
+ };
27
+
28
+ # Enter devshell with all the tools via "nix develop"
29
+ # or "nix-shell"
30
+ devShell = with pkgs;
31
+ mkShell {
32
+ buildInputs = [
33
+ actionlint
34
+ cargo
35
+ haskellPackages.hadolint
36
+ nodePackages_latest.cspell
37
+ nodePackages_latest.eslint
38
+ nodePackages_latest.markdownlint-cli2
39
+ nodePackages_latest.stylelint
40
+ nodePackages_latest.stylelint
41
+ rustPackages.clippy
42
+ rustc
43
+ yamllint
44
+ ];
45
+ RUST_SRC_PATH = rustPlatform.rustLibSrc;
46
+ };
47
+
48
+ # Build via "nix build .#websurfx.x86_64-linux"
49
+ websurfx = defaultPackage;
50
+ });
51
+ }